Explode() Replacement
6
Ever used the Explode() function, and in some parts of the returned array, are NULL values? Below is a function which will only return values which are not NULL. Depending on what you are trying to achieve, this could turn out to be useful.
<?php
function myFunction($seperator, $string){
$tmp = explode($seperator, $string);
foreach($tmp as $val)
if($val !== "") $arr[] = $val;
return $arr;
}
?>






There are currently no comments for this snippet.