php - Can't unset rows in my array -


i'm trying delete empty rows in arrays, can achieve that. need help.

here's i've tried :

        $specialites = serialize($_post['specialite']);         foreach($specialites $specialite) {             if($specialite=='')                 unset($specialites[$specialite]);         } 

but every time, error (blank page). need please. thank !

i check 1 problem serialize called first before foreach, actual problem. need this:-

 $specialites = $_post['specialite'];     foreach($specialites $key=> $special) {         if(empty($special) || $special == '')             unset($specialites[$key]);     }     $specialites = serialize($specialites); 

note:- if called serialize on variable no more array type variable.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -