Created
July 24, 2013 14:38
-
-
Save meniam/6071179 to your computer and use it in GitHub Desktop.
When you use list($a, $b) = explode('delimiter', $str) and in str delimiter doesn't exists php show warning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (count($segments = explode('By', $method, 2)) == 2) { | |
list($basePart, $by) = $segments; | |
} else { | |
$basePart = $method; | |
$by = ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment