Use of PHP built-in ltrim() to remove a single character
built-in, function, php, string
Solution
Just use preg replace it has a limit option
eg
$value = preg_replace('/^[aeiouy]/i', '', $value, 1);
Problem
Is there a simple way to use `ltrim()` to remove a single instance of a match instead of all matches? I'm looping through array of strings and I'd like to remove the first, and only first, match (vowels in this case): ``` ltrim($value, "aeiouyAEIOUY"); ``` With default behavior the string `aardvark` or `Aardvark` would be trimmed to be `"rdvark"`. I'd like result to be `"ardvark"`. I'm not bound to ltrim by any means but it seemed the closest built-in PHP function. It would be nice of `ltrim` and `rtrim` had an optional parameter "limit", just saying... :)