Jump to content
Sign in to follow this  
imcfanboy

php string bold

Recommended Posts

I've a mailtext and I want to set one element of the text strong. How is this possible?this is my text: $mailtext .= $name.$trenner.$einzelwert.$trenner2;

 

 

$name should be strong

 

 

Share this post


Link to post
Share on other sites

Is your mail being sent with a text/html content type header?

Share this post


Link to post
Share on other sites

You can just add <b> tags to the content if you want part of it bold.

$mailtext .= '<b>' . $name . '</b>' . $trenner . $einzelwert . $trenner2;

The mail client will interpret it properly if the Content-type header is set to text/html

  • Like 1

Share this post


Link to post
Share on other sites

use

<?php echo "<strong>" . $string. "</strong>"; ?>

The OP is asking how to bold text in an email

Share this post


Link to post
Share on other sites

<strong> also works in email, but I use <b> because it's not clear whether the words are meant to have emphasis on them or not. Screen readers ignore <b> tags while pronouncing <strong> elements with a change in tone of voice.

Share this post


Link to post
Share on other sites

The example he gave used echo. That would not be part of email sending code.

 

edit: possibly it was meant as a generic example. That could have been a poor interpretation on my part then

Share this post


Link to post
Share on other sites

try...

$mailtext .= '<b>' . $name . '</b>' . $trenner . $einzelwert . $trenner2;or$mailtext .= '<strong>' . $name . '</strong>' . $trenner . $einzelwert . $trenner2;

as mentioned above.

Share this post


Link to post
Share on other sites

try...

$mailtext .= '<b>' . $name . '</b>' . $trenner . $einzelwert . $trenner2;or$mailtext .= '<strong>' . $name . '</strong>' . $trenner . $einzelwert . $trenner2;

as mentioned above.

 

No need to repeat what has already been said a couple times already. If the OP is not watching the thread anymore, nothing we can do about it

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...