Explode string into array with no empty elements?

Try preg_split.

$exploded = preg_split('@/@', '1/2//3/', -1, PREG_SPLIT_NO_EMPTY);

Leave a Comment