Merco Burger…

Category : Davao Posted by : hoop
Posted on August 25, 2005 | Viewed 109 times

Before Mcdonald’s, Jollibee and Burger Machine came to town… the one burger for me that was worth eating was the Merco Burger…. made by the Merco restaurant.

Oh don’t let the crumpled look decieve you… in my gluttony I man-handled it a bit *snicker*

Try it whenever you come to Davao….

Working with fopen and URL fetching…

Category : Coder Posted by : hoop
Posted on August 25, 2005 | Viewed 100 times

I was coding a PHP rss reader for my site, one of the problems I had was when I found a none existant rss feed from the site that I was parsing. Instead of switching immediately to the ‘die’ part of the code, it would always stop in it’s tracks and print out that it couldn’t find the remote file.

Trying to create an error handling catch didn’t work the way I wanted it to with the code I got from google:

if (!($fp = fopen($file, “r”))) {
die(”could not open XML input”);
}

Searching a little further, I found a work around for PHP not to call these not found errors explicitly. That’s by preceding the function with a ‘@’.

if (!($fp = @fopen($file, “r”))) {
die(”could not open XML input”);
}

by modifying the code this way, PHP skips right away to the die portion.

Cool eh?

Powered by WP | Modified neuro | Web Directory