PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm trying to split a sting on capital letters. I'm sure I could do it with a loop through each character and gettting the ASCII value but I was thinking there might be a simple way to do it with preg_split. However I'm not very experienced with Regular Expressions.
Can anybody help?
As an example I'm trying to split the Text "RegularExpression" to an array like Array([0]=>Regular [1]=>Expression)
If you add delimiters to your expression "/[A-Z]/" it will work, unfortunately you lose the capital letters. preg_split() won't work here, but you can return an array of matches like:
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
As I said, preg_split() doesn't work as needed:
[text]Array
(
[0] =>
[1] => R
[2] => egular
[3] => E
[4] => xpression
)[/text]
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.