The Lazy way of working with XML Namespaces in PhP
Please understand the title of this message, this is a total hack but a good one, one that takes the complex notion of working with XML namespaces and makes it easy. There is a big chance that this will not work for ever application but it may help some in overcoming parsing complex XML.
The concept is quite simple, remove that which is causing the problem by using a string replace. Lets take the parsing of the Twitter Geo location. Make sure when applying this that you've checked to see that replaced value is unique.
Problem Area:
<twitter:geo>
<georss:point>40.3815 -79.8598</georss:point>
</twitter:geo>
Fix: Apply a string replace to the entire XML response, good by troublesome colons.
$response = str_replace("twitter:geo", "twittergeo", $response);
$response = str_replace("twitter:", "", $response);
$response = str_replace("georss:point", "georsspoint", $response);
I encourage you to read on and understand how to do this properly, but if examples are your thing here are a few.
Cannot load mcrypt extension. Please check your PHP configuration.
Here is a quick little tip on how to remove the "Cannot load mcrypt extension. Please check your PHP configuration." message from your phpMyAdmin login window on a Fedora 8 Linux Dedicated or maybe even virtual dedicated server at Godaddy.
1. Open a ssh session. Switch to root.
2. Run each line individually (or copy each one and right click on the ssh window (putty)).
yum install libmcrypt
yum install php-mcrypt
yum install php-mhash
I didn't have to restart http but you might want to for grins.
A big nod to wayan on this one, and PS, don't search for GoDaddy images on Google while at work
How to convert a website favicon.ico into an image
Few google searches bing back, oops, bring back amazing finds like this. However before reading on know that Google Share Stuff has been Discontinued since last March in favor of Google Reader's sharing bookmarklet. I'm not sure what that means to the favicon service defined below which clearly still works. You've been warned, meaning you can't expect it to work indefinably </captain obvious>
Google Shared Stuff (S2) offers a secret URL that can automatically pull favicon images of any website provided you know the URL. The images are in the PNG format (not ICO) and hence will render correctly in all browsers via the tag. - labnol.org
All you have to do is append a url to the following line and get the current favicon.ico of any website.
http://www.google.com/s2/favicons?domain=www.yancylent.com ->
I can't even tell you the trouble I went through a couple years ago writing a PHP routine that saved the files down to a folder, changed the name, added that name to a database, only to find out that IE Explorer didn't support .ico's like other browers do. This is a fine alternative, thanks google.