Stop using PHP4. If your host doesn't support PHP5 then get a new host.

Kind regards,
Keri Henare
---------------------------------------------------
[e]  [email protected]
[w]  kerihenare.com
[m]  (+64) 021 874 552
[t]  @kerihenare

PLEASE NOTE: I check my email 3 times per day and will respond at these 
intervals.  For anything urgent please ring me.
---------------------------------------------------

On 3/09/2010, at 10:02 PM, Sid Bachtiar wrote:

> Sorry no, I don't have any PHP 4 project at the moment. I guess you
> could replace simplexml_load_file function with whatever is available
> in PHP 4 for parsing XML string?
> 
> On Fri, Sep 3, 2010 at 9:57 PM, Admin <[email protected]> wrote:
>> 
>>     That's brilliant Sid... Thank you.
>> 
>>     Anything that'll run under PHP 4 though? (This is something we've been
>> beating against for a while, so I almost screamed in joy when this thread
>> appeared.)
>> 
>>     Cheers...
>> 
>>> $xml =
>>> simplexml_load_file('http://twitter.com/statuses/user_timeline/1234567
>>> 89.xml');
>>> 
>>> $statuses = array();
>>> 
>>> foreach ($xml->status as $status)
>>> {
>>> $text = htmlspecialchars($status->text);
>>> $text=preg_replace( "/(?<!<a
>>> href=\")((http)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\"
>>> target=\"_blank\">\\0</a>", $text );
>>> 
>>> $statuses[] = array(
>>> 'text' => $text,
>>> 'created_at' => $status->created_at,
>>> 'short_date' => date('M d', strtotime($status->created_at)), ); }
>>> 
>>> That preg stuff is for converting URLs into HTML a tags. Change
>>> 123456789 to your twitter ID.
>> 
>> 
>> 
>> ---
>> Karl
>> 
>> --
>> NZ PHP Users Group: http://groups.google.com/group/nzphpug
>> To post, send email to [email protected]
>> To unsubscribe, send email to
>> [email protected]
> 
> 
> 
> -- 
> Blue Horn Ltd - System Development
> http://bluehorn.co.nz
> 
> -- 
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to