가능한 중복 :
get the value of an url response with curlPHP에서 컬을 사용하는 방법?
지금 내가 컬을 사용하여이 페이지의 출력을보고 싶어 stores.php PHP 페이지 이름, 내가 무엇을 할 수 있나요? 내 코드는
<?php
include_once '../application/Boot.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$body = @file_get_contents('php://input');
$json = json_decode($body, true);
if (isset($json['version'])) {
$client_cache_version = @$json['version'];
$sql = $db->quoteInto("SELECT * FROM stores where version_modified > ". $client_cache_version);
$results = $db->fetchAll($sql);
$version_sql = $db->quoteInto("SELECT max(version_modified) as version FROM stores");
$version_results = $db->fetchAll($version_sql);
$count = array(
'count' => sizeof($results)
);
array_push($results, $version_results['0']);
array_push($results, $count);
//ob_start("ob_gzhandler");
header('HTTP/1.1 200 Stores list');
echo json_encode($results);
exit;
}else {
header('HTTP/1.1 400 Bad Request');
exit;
}
}else{
header('HTTP/1.1 400 Bad Request');
exit;
}
?>
다음과 같이 사용할 프록시를 통해 대상 URL을 열려면 , ...) 스크립트의 응답을 보여주기 위해 컬 (curl)을 사용하고 싶습니까? – scube
중복? http://stackoverflow.com/q/2001897/508702 –
@scube :) os is linux (우분투) – John