I have a array called $urls, I want to delete members with value null. I want first submit every member to a function that checks if a member is null, and then I delete the member from array. E.X.
$urls=array();
$url[0]=$_POST['urla'];
$url[1]=$_POST['urlb'];
$url[2]=$_POST['urlc'];
$url[3]=$_POST['urld'];
$url[4]=$_POST['urle'];
Well, I want to delete $urls members that has no value (because user didn't fill out the fields ), How can I do it? thank you for your help
array_filter$url = array_values($_POST);. Note thatnullimplies that values might not exist, so your current code will generate warnings for every non-existing element. Also note that you can use arrays in html which would probably make all this redundant.