jaymc Posted April 20, 2008 Share Posted April 20, 2008 just a quick one, I cant remember how to do this I want to execute a function on every element in an array, but leave the result in the array So instead of this $song_data[song_name] = mysql_real_escape_string($song_data[song_name]); $song_data[artist_name] = mysql_real_escape_string($song_data[artist_name]); $song_data[album_name] = mysql_real_escape_string($song_data[album_name]); $song_data[genre] = mysql_real_escape_string($song_data[genre]); $song_data[year] = mysql_real_escape_string($song_data[year]); $song_data[kbps] = mysql_real_escape_string($song_data[kbps]); I could have something like magic_function($song_data, mysql_real_escape_string()); Thanks! Quote Link to comment Share on other sites More sharing options...
dptr1988 Posted April 20, 2008 Share Posted April 20, 2008 array_walk() http://us2.php.net/manual/en/function.array-walk.php Quote Link to comment Share on other sites More sharing options...
jaymc Posted April 20, 2008 Author Share Posted April 20, 2008 Great Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.