I have an error on the following code:
$name = "Bush Dvd Player";
print "<a href='?name".print str_replace(' ', '-', $name).".html' >Previous</a>";
On the page is shows the following:
Car-Parts-and-Accessories however not in a url format?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
str_replace()returns a string that will be concatenated to the output string, therefore there is no need for the additionalprint, so just omit it:Your old code would print out the result of
str_replace, followed by the concatenation of the first string literal, along with the return value ofprint str_replace(' ', '-', $name), and then then 2nd string literal.