Page 1 of 1

Alternative to perl LWP in php

Posted: Wed May 28, 2003 5:28 am
by coolpravin
Does anybody knows alternative to Perl's
LWP in php.
I want to convert
$ua = LWP::UserAgent->new;
$request = HTTP::Request->new(POST => $server);
$request->content($post);
$response = $ua->request($request);
$response = $response->content;

$response =~ /<status>([^<]+)<\/status>/;
my $ret = $1;
$ret = 0 if ($1 eq '00');
return $ret;
This code from cgi-perl to php
Does anybody know how?

Posted: Wed May 28, 2003 9:15 am
by Stoker
You could use curl, but it requires curl compiled in with PHP, I use this all the time to post to various CC Gateways and XML services and such.. If you don't have it compiled in to PHP youc an still use it thru a shell and the command line tool, there are some other posts about this on the forum, search for curl..

Posted: Wed May 28, 2003 11:01 am
by volka
and there's also http://snoopy.sf.net
a php class to emulate a browser requesting a new document.