Skip to content

Instantly share code, notes, and snippets.

@neps-in
Created October 7, 2019 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neps-in/70dbd6f613d6d70f463c8bc98d6a2bc6 to your computer and use it in GitHub Desktop.
Save neps-in/70dbd6f613d6d70f463c8bc98d6a2bc6 to your computer and use it in GitHub Desktop.
explode can use words as delimiters
<?php
//Even words can be use as delimiters in php explode function.
$s = 'Napoleon and Arouldas';
$s_pieces = explode('and', $s);
$rating = $s_pieces[0];
$review_count = $s_pieces[1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment