unknownsheep Posted February 13, 2008 Share Posted February 13, 2008 Hello, I've tried to figure this out myself but I guess I'm too dumb.. Anyhow.. I want to replace the character ^ followed by a number from 0-9 with nothing. Examples: ^4Hello becomes Hello ^a1bc^5de becomes ^a1bcde ^P^128 becomes ^P28 Thank you. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted February 13, 2008 Share Posted February 13, 2008 <?php $subject = '^a1bc^5de'; echo $subject, ' becomes '; $subject = preg_replace('|\^[0-9]|', '', $subject); echo $subject; // ^a1bc^5de becomes ^a1bcde ?> Quote Link to comment Share on other sites More sharing options...
unknownsheep Posted February 13, 2008 Author Share Posted February 13, 2008 Works great, thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.