Hello All,
I am needing some assistance. I am trying to add some Cc and Bcc to a
mail script I have.
On the form I have instructions for each to be separated by a comma +
a space.
In an all perfect world each user would do this perfectly. ...but
since were working with something different,
On 2011-07-13 09:54, Karl DeSaulniers wrote:
$cc = ema...@domain.com ,ema...@doamin.com,ema...@domain.com ,
ema...@domain.com,
$cc = trim($cc,,);
$result = preg_replace('/(\s?)(,)(\s?)/i', ',', $cc);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Wednesday 13 July 2011 11:09:45 Jay Ess wrote:
On 2011-07-13 09:54, Karl DeSaulniers wrote:
$cc = ema...@domain.com ,ema...@doamin.com,ema...@domain.com ,
ema...@domain.com,
$cc = trim($cc,,);
$result = preg_replace('/(\s?)(,)(\s?)/i', ',', $cc);
The solution is broken because of:
1)
On 2011-07-13 10:36, Vitalii Demianets wrote:
On Wednesday 13 July 2011 11:09:45 Jay Ess wrote:
On 2011-07-13 09:54, Karl DeSaulniers wrote:
$cc = ema...@domain.com ,ema...@doamin.com,ema...@domain.com ,
ema...@domain.com,
$cc = trim($cc,,);
$result = preg_replace('/(\s?)(,)(\s?)/i', ',',
If you are looking for a one liner reg ex, it may take some time. This may
lead wasting your development time. Better you do the following,
1. replace the string with tokens in address.
2. Split using comma.
3. Apply common email regex.
4. Replace tokens with actual strings.
5. Rebuild/join the
5 matches
Mail list logo