Applying CSS on PHP variable [closed]

  1. do not use <font> html tag, it is old and i’m not even sure if can work in modern browsers. instead use <span> (for inline text) or <p> (for paragraph).

  2. php and html can work together but there’s an appropriate way to write it.
    generally speaking, html code is wrapped with double quotes "html" and php with periods .php.:

    echo "html code here".php code here."more html here";
    
  3. i advice you first to set a variable for the $message and after it call the var inside the echo code. that way it would be a cleaner code.

so here is a final solution for you:

$message = str_replace('{eventlinkURL}',$eventlinkURL,$message); 
echo "<span style="background:red;">".$message."</span>";

good luck,

Ituk