Kiwwito

Code Snippets and More

If you've used the explode function in PHP probably you've noticed unexpected empty results

$string = '';
explode(',', '');
// array(0 => '')

This could be fixed by using the function preg_split

$string = '';
preg_split('/,/', $string, null, PREG_SPLIT_NO_EMPTY))
// array()

Recent comments

© 2014 Copyright by Keyvan Akbary