Jump to content

email issue, replace spaces with -


jarvis

Recommended Posts

Hi All,

 

I've the following code:

  foreach ($subscribers as $record) {
      $from    = "[email protected]";
      $to      = $record['email'];
      $subject = "Article Added to the ". $clientName . " client";
      $message = "A new article entitled '". @$_REQUEST['title'] . "' has been added to the {$clientName} client";
      $message .= "\n". @$_REQUEST['summary'] ."\n\n";
      $message .= "\nClick here to to view it: http://www.domain.com/news.php?". @$_REQUEST['title'] ."-". $num;

It works but if the title has spaces in, the link in the email fails. How can I replace the title with -?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/193749-email-issue-replace-spaces-with/
Share on other sites

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.