Saturday 15 May 2010

best method to manipulate array keys in PHP -


I have an associative array, I need to add ':' at the beginning of all the keys. Will it be the fastest / straightforward way of doing this?
And what would be the most effective way to do this?

The easiest way would be to create a new array:

  $ NewArray = array (); Forex currency ($ key as $ key = & gt; $ value) {$ newArray [":" $ of] = $ value; }  

No comments:

Post a Comment