SharkBait Posted August 23, 2007 Share Posted August 23, 2007 Ok I am trying to concat some strings together but its acting a bit odd and hopefully someone can explain to me why it is doing it. <?php $emails_addresses = array("thank you" => "[email protected]", "Kim" => "[email protected]", "Bob" => "[email protected]",); $email_group = array( 0 => array("thank you", "Kim"), array("thank you", "Bob") ); $string = ""; foreach($email_group[0] as $person) { $string .= "{$person} <{$email_addresses[$person]}>, "; } ?> Now what that does it because of the < and > it seems to strip out the email addresses. If i put spaces between the < and > so it looks like thank you < [email protected] > as opposed to thank you <[email protected]> it will show up, but I am curious why the < and > are stripping the email from the string. I have also done it this way and the same thing happens: <?php $string .= $person . " <". $email_addresses[$person] .">, "; ?> Am I missing some concept of strings?? Eventually this is what I want to have happen: $string = "thank you <[email protected]>, Kim <[email protected]>"; ** Note: Why is it I type T y together it comes up as Thank you ?? I don't have any weird text replace macros running on my machine. Link to comment https://forums.phpfreaks.com/topic/66390-weird-string-happenings/ Share on other sites More sharing options...
Jessica Posted August 23, 2007 Share Posted August 23, 2007 because < and > are HTML open and close tags. So the browser thinks that is HTML. Use < and > instead or run htmlentities on it first. I've been gone a while but maybe the forum has a no-chatspeak rule Link to comment https://forums.phpfreaks.com/topic/66390-weird-string-happenings/#findComment-332253 Share on other sites More sharing options...
MadTechie Posted August 23, 2007 Share Posted August 23, 2007 it works fine.. view sourse Link to comment https://forums.phpfreaks.com/topic/66390-weird-string-happenings/#findComment-332259 Share on other sites More sharing options...
SharkBait Posted August 23, 2007 Author Share Posted August 23, 2007 Oh yea.. silly me I forgot about that Thanks! Link to comment https://forums.phpfreaks.com/topic/66390-weird-string-happenings/#findComment-332267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.