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" => "blah@blah.com", "Kim" => "blah2@blah.com", "Bob" => "bob@bob.com",); $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 < blah@blah.com > as opposed to thank you <blah@blah.com> 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 <blah@blah.com>, Kim <blah@blah.com>"; ** 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. Quote 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 Quote 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 Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/66390-weird-string-happenings/#findComment-332267 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.