You can use preg_split
as:
$arr = preg_split('/(?=[A-Z])/',$str);
I’m basically splitting the input string just before the uppercase letter. The regex used (?=[A-Z])
matches the point just before a uppercase letter.
More Related Contents:
- How to validate that a string only contain lowercase letters?
- Regex to match an IP address [closed]
- Find a match pattern of any digit and space with any character in a string and replace with | in PHP [closed]
- PHP regular expressions: No ending delimiter ‘^’ found in
- Delimiter must not be alphanumeric or backslash and preg_match
- Remove new lines from string and replace with one empty space
- How to remove accents and turn letters into “plain” ASCII characters? [duplicate]
- Capturing text between square brackets in PHP
- Remove multiple whitespaces
- How do I remove all specific characters at the end of a string in PHP?
- Remove control characters from PHP string
- PHP remove special character from string
- PHP – regex to allow letters and numbers only
- How to split a long string without breaking words?
- Php – regular expression to check if the string has chinese chars
- Extracting all values between curly braces regex php
- Function eregi() is deprecated [duplicate]
- Get repeated matches with preg_match_all()
- Unknown modifier ‘/’ in …? what is it? [duplicate]
- PHP – Add link to a URL in a string
- Get last whole number in a string
- Close open HTML tags in a string
- How to search in an array with preg_match?
- Regex & PHP – isolate src attribute from img tag
- How to validate a domain name using Regex & PHP?
- Test if a string is regex
- PHP email validation [duplicate]
- How to remove numbers from a string with RegEx
- How to get the shortest rather than longest possible regex match with preg_match()
- Detecting a url using preg_match? without http:// in the string