How do I change the color of an echo message and center the message in the PHP I've written. The line I have is:
echo 'Request has been sent. Please wait for my reply!';
How do I change the color of an echo message and center the message in the PHP I've written. The line I have is:
echo 'Request has been sent. Please wait for my reply!';
How about writing out some HTML tags and some CSS if you're outputting this to the console?
echo '<span style="color:#AFA;text-align:center;">Request has been sent. Please wait for my reply!</span>';
Won't work from console though, only through browser.
If it echoing out to a browser, you should use CSS. This would require also having the comment wrapped in an HTML tag. Something like:
echo '<p style="color: red; text-align: center">
Request has been sent. Please wait for my reply!
</p>';
Use the below code, it would be faster for you if you go through a basic HTML/CSS Tutorial.
echo '<div style="text-align:center; color:red">Request has been sent. Please wait for my reply!</div>';
How about writing out some escape sequences?
echo "\033[01;31m Request has been sent. Please wait for my reply! \033[0m";
Won't work through browser though, only from console ;))