php - Json decode store in single var -
hie all, have $id="1,2,3,";//like this
wanted pass within function like..
<input type="submit" onclick="<?php echo 'edit($id)';?>">
i have $id in json_encoded format. want decode it. , store each in single var.
foreach() { // single var store each decoded .. }
in file1 save id in hidden field,
<form method="get" action="file2.php"> <input type="hidden" name="ids" value="<?php echo $id;?>"> <input type="submit"> </form>
in file2 this,
$id = $_get['ids']; $id_arr = explode(',',$id); // gives array
Comments
Post a Comment