Created
February 22, 2019 08:29
-
-
Save ssatz/26b01a04c78a7eb33cfb90f312a08633 to your computer and use it in GitHub Desktop.
preg split
This file contains hidden or 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
<?php | |
$e =preg_split('/(?=[\s][0-9]+)/i','Red chilli powder 2.50 tbsp'); | |
print_r($e); | |
//Array ( [0] => Red chilli powder [1] => 2.50 tbsp ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment