Skip to content

Instantly share code, notes, and snippets.

@meniam
Created July 24, 2013 14:38
Show Gist options
  • Save meniam/6071179 to your computer and use it in GitHub Desktop.
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
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