jfarthing Posted December 21, 2007 Share Posted December 21, 2007 Whats the best way to remove a value from an array without knowing the index in PHP4.4 I have a function that works in 5.1 or higher but the server im using has 4.4 Link to comment https://forums.phpfreaks.com/topic/82734-solved-array-remove/ Share on other sites More sharing options...
jfarthing Posted December 21, 2007 Author Share Posted December 21, 2007 Nevermind, came up with my own: function array_remove($array, $value) { $arr = array_diff($array, $value); $arr = array_values($arr); return $arr; } Link to comment https://forums.phpfreaks.com/topic/82734-solved-array-remove/#findComment-420808 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.