Jump to content

php string bold


imcfanboy

Recommended Posts

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
Link to comment
Share on other sites

use

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

The OP is asking how to bold text in an email

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...