Fonctons utiles PHP
Grab - array ajax
Le code parle de lui même, cela permet avec une petite expession régulière d'avoir un code plus light que du JSON !
<?php
$data="toto=1; tintin=pejrp; dwtf=12354; ";
function grab($str){
global $data;
preg_match("/\b$str=[\"']?([\d\w,;\/\. ]+)[\"']?;/i",$data,$o);
if($o[1]){
if($o[1]=="false")return false;
if($o[1]=="undefined")return false;
global $$str;
$$str=$o[1];
echo "<LI>\$str=$str";
echo "<LI>\$$str=".$$str;
return $o[1];
}else{
return false;
}
}
grab("toto");
?>