livewirerules Posted February 10, 2010 Share Posted February 10, 2010 Im trying to remove an element from an array, but the problem is that although that it removes the value and adds it again into the array.. if (isset($_POST['remove'])) { $ele=$_GET['id']; //id passed from the form $key1=array_search($ele,$_SESSION['id']); echo $key1; unset($_SESSION['id'][$key1]); } can some one tell me what i am doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/191656-remove-an-element-from-an-array/ Share on other sites More sharing options...
WolfRage Posted February 11, 2010 Share Posted February 11, 2010 You have way to many things going on and I doubt that you are actually using both GET and POST. But just to be sure going to need to see some more code and will need a better explanation of what you want to happen. Quote Link to comment https://forums.phpfreaks.com/topic/191656-remove-an-element-from-an-array/#findComment-1010597 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.