»
S
I
D
E
B
A
R
«
PHP: sample output of integer-based array after serialize()
Nov 16th, 2009 by admin

I was hoping to avoid writing a script to give me this basic information, but alas, I did not.

There are plenty of examples of serializing string-based arrays, but I found none with integers — granted I did not waste much time searching. Anyway, below is the PHP code, the the appropriate output.

<?php echo serialize(array(1,2,3)); ?>

a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}

Nick

»  Substance: WordPress   »  Style: Ahren Ahimsa