Friday afternoon problem array question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Friday afternoon problem array question (/showthread.php?tid=14824) |
Friday afternoon problem array question - El Forum - 01-16-2009 [eluser]tim1965[/eluser] Sorry in advance i know this is easy. But my brain doesnt seem to functioning today. I want to add $propid = $this->session->userdata('propid'); to a POST array If i var_dump $propid i get Quote:array(1) { ["prop_id"]=> array(1) { [0]=> string(1) "5" } } Quote:So if i use $form['property_id'] = $propid['prop_id']; It adds "array" rather than "5", which is the value i am trying to get Any help appreciated Friday afternoon problem array question - El Forum - 01-16-2009 [eluser]majidmx[/eluser] As you can see in your var_dump Code: $propid['prop_id'] [/code] Code: $form['property_id'] = $propid['prop_id']; instead try to print this : Code: echo $form['property_id'][0]; or you can simply use this : Code: $form['property_id'] = $propid['prop_id'][0]; Code: echo $form['property_id']; Friday afternoon problem array question - El Forum - 01-16-2009 [eluser]tim1965[/eluser] Thank you, fixed it, have a great weekend ! |