PHP separates strings into arrays of strings in uppercase letters

  • 2020-03-31 20:42:20
  • OfStack

Alert (" createTechBook ". The split (/ (? = [a-z]) /)) thanks
 
<?php 
$str="abcDefGhi"; 
/* 
preg_match_all("/([a-zA-Z]{1}[a-z]*)?[^A-Z]/",$str,$array); 
*/ 
$array=preg_split("/(?=[A-Z])/",$str); 
print_r($array); 
?> 


 
<?php 
$string = "createTechBook"; 
$arr = preg_split("/(?=[A-Z])/", $string); 
print_r($arr); 
?> 

Can also be

Related articles: