remove specific element from array in php

technical talkiess
0

 <?php


$months = array('jan', 'feb', 'march', 'april', 'may','jun','july','augest','sep','oct','nov','decem');

$delete_month = 'sep';


if(($key = array_search($delete_month,$months)) !=='false'){

unset($months[$key]);

}

print_r($months);

?> 

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)