I know HTTP extension is depracated in PHP 5.3 onwords. So is their any way to make a HTTP response. This is my php code in php 5.2. How to make it suitable for php 5.4.

//process the request by fetching the info
$headers = http_get_request_headers();
$result = http_get_request_body();
//do stuff with the $headers and $result variables....
//then send your response
HttpResponse::status(200);
HttpResponse::setContentType('text/xml');
HttpResponse::setHeader('From', 'ABCD');
HttpResponse::setData($sq_data);
HttpResponse::send();
有帮助吗?

解决方案

I think this is based on a misunderstanding:

"in further version of php http extension is not available. iam using wamp server."

The PECL HTTP extension is perfectly available for any current PHP version, it's simply not installed by default and must be installed as a PECL extension. In the best case that's as simple as this typed on the command line:

$ pecl install pecl_http
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top