/* {{{ FONCTIONS A LA PHP ====================== */ // fonctions pour (de)serializer un tableau javascript function serialize(a) { return a.toString(); } function unserialize(s) { return s.split(","); } function trim(s) { return s.replace(/^\s+/, '').replace(/\s+$/, ''); } function ltrim(s) { return s.replace(/^\s+/, ''); } function rtrim(s) { return s.replace(/\s+$/, ''); } /* {{{ is_array */ function is_array(obj) { return (obj.constructor.toString().indexOf("Array") != -1) // return (obj.constructor.toString()) } /* }}} */ /* {{{ strpad : equivalent de la fonction PHP */ function strpad(val, longueur, remplissage) { if (!isNaN(val)) { while ((val.toString().length < longueur)) val = remplissage+val; return val; } else return false; } /* }}} */ /* {{{ print_r : equivalent de la fonction PHP */ function print_r (theObj, stripfunctions) { if (theObj.constructor == Array || theObj.constructor == Object) { document.write('