Archive for March, 2005

5 minuten upgrade: Wordpress 1.5

Net de sprong gemaakt naar Wordpress 1.5. Adem inhouden en hopen dat alles werkt. Gelukkig geen problemen tegengekomen.

De upgrade handleiding vraagt om je database en aangepaste files ergens veilig op te slaan indien alles in de soep draait. Dat is een standaard procedure die niemand overslaat, toch niet de als het gaat over een pc van iemand anders. Toch maar doen zou ik zeggen, zelfs nadat ik hier bevestig dat het voor mij absoluut niet nodig was.

Files uploaden, upgrade script draaien. Daarna je index bestand terug zetten en gedaan.
Fantastisch werk!

Intermezzo

XML into PHP array using XSLT

Don’t want to read everything? Jump to the code or leave a comment

9 months ago I wrote a few lines PHP-code to get XML data into an array. The reason why I wrote this is hard to recall but in the process I had to solve a problem: how do I get a serie of values from an XML file into a PHP array?

Lots of solutions exist like the package PEAR::XML_Serializer but they were all too advanced for what I needed.
All I needed was a simple function or class that would do just that: convert xml file with values to php array. And I found a simple trick using nothing more than XSLT.

If you look at an array in PHP, the data inside is a storable presentation of a value. To get the value back into a string you have to call the serialize() function. Getting the array back from the string, you guessed it, call the unserialize() function. I’m not getting any deeper into this, the manual entries are very clear and the array section of the PHP manual is very good.

Once you know how a serialized array looks like, you can generate it with whatever you have. You can generate it through an XSLT transformation, like I did.

(more…)

Categories

About

My name is Len Dierickx and this is my personal blog. I studied Musicology at the UG, long time ago but got more and more into webdevelopment. I started this blog because the EuroIA summit in Brussels (Belgium, Oct 2005), was such an inspiration. And I was thinking about a blog on IA a while now, so that was the extra kick I needed to get it actually done.

Powered by WordPress