Jump to content

Substitution and checking expression


kepler

Recommended Posts

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:[email protected]"

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

Link to comment
https://forums.phpfreaks.com/topic/282413-substitution-and-checking-expression/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.