Is there an easy way to use ltrim() to remove a single instance of a match instead of all matches?
I iterate over an array of strings, and I would like to remove the first and only the first, match (vowels in this case):
ltrim($value, "aeiouyAEIOUY");
In the default behavior, the string aardvark or aardvark will be aardvark as "rdvark" . I would like the result to be "ardvark" .
I am not tied to ltrim by any means, but it seemed like the closest PHP built-in function. It would be nice ltrim , and rtrim had an optional parameter "limit", just saying ... :)
source share