Saturday, May 20, 2006

Learning PHP Again

I had no special activities today at night so i have some spare time time to do one of my favourite activities which i rarely do it anymore which is learning PHP. I used C# as my default language at work, so it's quite different with PHP itself and my main project is desktop application, meanwhile PHP was intended to build a web-based application (even though there is a php-gtk project, but i haven't tried that yet). Since i have upgraded my PHP in my Windows system up to 5.1.x, i should try to learn the new features that are available in PHP 5.1.x version. I have read some of the Object Oriented functionality in PHP 5.1.x and since i have some basic skill of Java and working with C# which uses Object Oriented style also, i can understand most of them, except for some special syntax which is quite different.

Today i tried to learn about cURL library to get the content of an URL which contains a XML file (mostly RSS, since i want to make a code that parses RSS file or you can name it RSS Grabber) and then i will parse it and output it as a formatted HTML code, but as i tried, i haven't find a perfect solution to send cURL handler resource to another function which expect a file name as the parameter. So i switched to use fopen() function to try open the XML file and then parse it using the DOM function. It has used an Object Oriented style, but it still contains some old function which hasn't been converted to Object Oriented style and should be avoided (as written in PHP Manual). Well, it worked for me now after looking for examples in PHP manual, but i'm still updating it so it will have better output results by giving the correct CSS code. I plan to put it in Informatix website. It will grab file from another RSS Feed and display it in the page, just like PlanetPlanet website.