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

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -