kepler Posted September 24, 2013 Share Posted September 24, 2013 Hi,I have a flash movie that calls a PHP script to send an email. The problem is that sometimes the variable comes like this: "Email:joe@domain.com"How can I check and chop the "Email:" part of the variable? And how do I remove any trailing and ending spaces after? And - sorry for asking so many questions - do I exit the script if the result variable is null?Kind regards, Kepler Quote Link to comment https://forums.phpfreaks.com/topic/282413-substitution-and-checking-expression/ Share on other sites More sharing options...
Solution Ch0cu3r Posted September 24, 2013 Solution Share Posted September 24, 2013 How can I check and chop the "Email:" part of the variable? There are many ways to modify text with PHP. Some functions you can use str_replace or substr or using regualr expressions with preg_replace And how do I remove any trailing and ending spaces after? You can use trim And - sorry for asking so many questions - do I exit the script if the result variable is null? Ask as many questions as you like Quote Link to comment https://forums.phpfreaks.com/topic/282413-substitution-and-checking-expression/#findComment-1451072 Share on other sites More sharing options...
kepler Posted September 24, 2013 Author Share Posted September 24, 2013 Hi, Thank you very much. Problem solved ! Kind regards, Kepler Quote Link to comment https://forums.phpfreaks.com/topic/282413-substitution-and-checking-expression/#findComment-1451080 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.