Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function strReplaceFirst($search, $replace, $subject)
- {
- $pos = strpos($subject, $search);
- if ($pos !== false) {
- return substr_replace($subject, $replace, $pos, strlen($search));
- }
- return $subject;
- }
Add Comment
Please, Sign In to add comment