Jump to content

Weird String happenings....


SharkBait

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.