Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
9 - 7 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Drop down menu with unserlize function ?
by mawi27 on 2008/5/19 14:37:23

Hi slyss,
the unserialize() function explained by trabis is much better than parsing the string as i have worked out in your other posts! You should change your code so that you only use this function.

best regards,
Marco
Re: Drop down menu with unserlize function ?
by slyss on 2008/5/19 6:31:06

many thanks ;)
Re: Drop down menu with unserlize function ?
by trabis on 2008/5/18 22:11:04

You can test diferent outputs this way:
<?php $countries = 'a:2:{i:0;s:7:"abruzzo";i:1;s:10:"basilicata";}'; //$countries = 'a:2:{s:5:"milan";s:6:"Milano";s:6:"naples";s:6:"Napoli";}'; $data = unserialize($countries); foreach ($data as $key=>$value){ echo $key.' -> '.$value.'<br />'; } ?>


As you see one uses keys and the other does not.
Re: Drop down menu with unserlize function ?
by trabis on 2008/5/18 21:56:00

le="color: #000000"><?php $countries = 'a:2:{i:0;s:7:"abruzzo";i:1;s:10:"basilicata";}'; $data = unserialize($countries); echo $data[0];//abruzzo echo $data[1];//basilicata
Re: Drop down menu with unserlize function ?
by slyss on 2008/5/18 21:34:07

hi marco


if i have this:


le="color: #000000"><?php $countries = 'a:2:{i:0;s:7:"abruzzo";i:1;s:10:"basilicata";}';


how i can extract countries?

thanks a lot

Who's Online

156 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 156


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits