Rename keys in array PHP -


hey all: have array:

 $names = array('a','b','c');  foreach($names $key => $value ) {     echo $key; } 

where a, b, c come name[] field

the input is:

 0 1 2 

there array function replace output result as:

 1 2 3 

i want rename first key because i'll insert theme mysql table.

why rename? use $key + 1 when needed.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -