beta it republik » News

News

Untitled Document
News

Tips on Fixing Flickr Namespace and Array _Multisort()Issues in PHP 5.2

Over at a new post on his blog, Ban Ramsey notes the issues he faced after upgrading to PHP 5.2.

  • The Flickr photo feed no longer worked
  • The blogroll was not sorting alphabetically


For the first issue, Ben found out his Flickr photo feed crashed because Flickr had changed the namespace string in their feed. The code stopped working because the namespace lacked a trailing slash (/), and SimpleXML was no longer able to properly get the data. So, he changed a code bit that earlier read:

->children('http://search.yahoo.com/mrss');

to:

->children('http://search.yahoo.com/mrss/');

To tackle the second issue, Ben added the SORT_STRING flag as a parameter to array_multisort () in the code, like so:



<?php

array_multisort(, SORT_ASC, SORT_STRING, );

?>





Comments



Name:




Comment:

Captcha Verification !
captcha_image