skip to Main Content

I use Sambroadcaster

change color of a text in php with echo

this is the code:

<span id="currently-playing-title"><?php echo $currentSong->artist_title;; ?></span><?php if ($currentSong->isRequested) echo "[Request]"; ?>

This is the text that i want to change the color [Request]

The next code is:

<?php if($comingSong->isRequested): ?>[Request]

In this line i want also change the color of the text [Request]

In the css there is no rule al the text colors are white

Any idea?

I try to find a solution in the css file but there is no rule herfore

2

Answers


  1. Chosen as BEST ANSWER

    Hi Hammad this one works great! Thanks!!!


  2. How about writing out some escape sequences?

    echo "33[01;31m [Request] 33[0m"";
    

    this line only work in console

    Another way is writing out some HTML tags and some CSS if you’re outputting this to the browser?

    echo '<span style="color:#AFA;text-align:center;"> [Request] </span>';
    

    Remember last line code Won’t work from console though, only through browser.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search