cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: How to a parse result using curl?

From: Ed Burie <ed_at_gallerypad.com>
Date: Sun, 24 Feb 2002 09:18:28 -0500

$TmpResult = $result;

$cnt = 1;

while ($TmpResult = strchr($TmpResult,"="))
{
         if (strpos($TmpResult,"<br>") > 0)
                 $value = substr($TmpResult,1,strpos($TmpResult,"<br>")-1);
         else
                 $value = substr($TmpResult,1);
         print "Name$cnt = $value<br>";
         $TmpResult = substr($TmpResult,2);
         $cnt++;
}

Hope this helps...

-Ed

At 02:13 AM 2/24/02 -0800, you wrote:

>Hi everyone!
>
>This newbie is over his head again! Any help would be appreciated&
>
>I m trying to parse the result from curl. So far my code basically ends
>with $result = curl_exec ($ch);
>
>Curl outputs the results to the browser. I need to be able to not only
>parse it, but to put the values into a table. The return string is
>separated by <BR>
>
>Example: name1=value1<br>name2=value2<br> name3=value3<br> name4=value4
>
>I need it to display like below in a table:
>
>|Text here $value1
>|Text here $value2
>|Text here $value3
>|Text here $value4
>
>Any idea s/help/examples would be greatly appreciated! I ve looked through
>2 PHP books and I m still lost L
>
>
>
>Thanks everyone!
>
>Dan
>
>
>
>
Received on 2002-02-24