aika Posted June 14, 2009 Report Share Posted June 14, 2009 (edited) Ir vēlme uzzīmēt grafiku. Problēma - kā nodot array zīmēšanas skriptam: <img src='drow_image.php?ydata=???'> // ydata ir jābūt grafika vērtību arrajam! Var protams apčakarēt ar stringu, kuru pēc tam sasplito arajā, bet var'but ir kāds tiešs veids kā nodot array? Edited June 14, 2009 by aika Quote Link to comment Share on other sites More sharing options...
bubu Posted June 14, 2009 Report Share Posted June 14, 2009 Nav nekāda cita veida. GET pieprasījumā var padot tikai stringu. Tā ka serializē to masīvu uz stringu un padot kā parasti padot GET pieprasījuma argumentus. Quote Link to comment Share on other sites More sharing options...
J0ke Posted June 15, 2009 Report Share Posted June 15, 2009 (edited) kapēc ne... caur get mierīgi var padot masīvu /script.php?masivs[2]=viens&masivs[1]=divi&masivs[3]=triis Array ( [masivs] => Array ( [2] => viens [1] => divi [3] => triis ) ) vai /script.php?masivs[]=viens&masivs[]=divi&masivs[]=triis Array ( [masivs] => Array ( [0] => viens [1] => divi [2] => triis ) ) vai pat tā /script.php?masivs[a]=viens&masivs=divi&masivs[c]=triis Array ( [masivs] => Array ( [a] => viens [b] => divi [c] => triis ) ) Edited June 15, 2009 by J0ke Quote Link to comment Share on other sites More sharing options...
endrju Posted June 15, 2009 Report Share Posted June 15, 2009 Labāk to realizēt ar implode() un explode(). Mazāk lieki dati plūdīs. Quote Link to comment Share on other sites More sharing options...
J0ke Posted June 15, 2009 Report Share Posted June 15, 2009 un kā jau čatā pārspriedām lai cilvēks arī apskatās uz serialize() un unserialize() varbūt dzīvē noderēs :D Quote Link to comment Share on other sites More sharing options...
bubu Posted June 15, 2009 Report Share Posted June 15, 2009 kapēc ne... caur get mierīgi var padot masīvu /script.php?masivs[2]=viens&masivs[1]=divi&masivs[3]=triis Tu nepadod masīvu. Tu padod vairākus GET argumentus kā stringus (no JS viedokļa). To kā php galā tas tiek apstrādāts ir cita runa. Quote Link to comment Share on other sites More sharing options...
codez Posted June 15, 2009 Report Share Posted June 15, 2009 (edited) Sarežģītāku datu struktūru nodošanai, gandrīz vienmēr izmantoju JSON, masīvam arī tīri labi noderēs. JS: http://code.google.com/p/jquery-json/ PHP: http://lv.php.net/manual/en/ref.json.php Edited June 15, 2009 by codez Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted June 15, 2009 Report Share Posted June 15, 2009 URI ir maksimālais garums: IE - 2083 simboli FF - līdz 2GB Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.