Jump to content

error using explode function, I think anyways..


MidOhioIT

Recommended Posts

I think my issue is being caused from using the explode function but not sure.  I have a form that passes the variable $content

$content = $_POST["content"];

to the following function:

$mywords = explode('', $content);
              $finalstring = '';
              foreach($mywords as $word) 
		  {
                 if(strlen($finalstring) <= 1200) 
		     {
                   $finalstring = $finalstring . ' ' . $word;    
                 } 
			 else 
			 {
			  $finalstring = $finalstring . ' .';    
				break;
			 }
          } 

 

This collects the info and sends to an email.  If i put a hyperlink in the textarea that uses content:

 

<a href='http://www.phpfreaks.com'>PHP Freaks</a>

 

I get the following in the email which obvisoulsy does not work because of the "\":

<a href=\'http://www.phpfreaks.com\'>PHP Freaks</a>

 

any ideas would be helpful

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.