Echo quotes problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JayCutler
Forum Newbie
Posts: 1
Joined: Tue Jan 04, 2011 4:04 pm

Echo quotes problem

Post by JayCutler »

Hello people :) Happy New Year !
Thanks to all of you for the help :)
Last edited by JayCutler on Wed Jan 05, 2011 1:56 pm, edited 1 time in total.
jankidudel
Forum Commoner
Posts: 91
Joined: Sat Oct 16, 2010 4:30 pm
Location: Lithuania, Vilnius

Re: Echo quotes problem

Post by jankidudel »

I'ts very bad practice to mix php with javascript int <script> </script> tags
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Echo quotes problem

Post by social_experiment »

What about

Code: Select all

<?php
 $variable = ucwords(str_replace("-", " ", $searchterm));
 echo "<script>color (". $variable .")</script>";
?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply