Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
July 28, 2007, 3:33 pm
rate this thread
echo '<tr><td>First name:</td><td><input type="text" name="first_name"
What purpose do the single quotes serve in
I don't mean the single quotes around first_name. I mean the single
quotes before and after the periods.
Re: How do you interpret single quote embedded in double quote embedded in single quote?
I am by no means a PHP expert, but I believe you are being misled by
an assumption. The assumption that something is wrong about the single
quotes. That's not the case.
What you have here is a single quoted string that is concatinated to
the result of the htmlspecialchars function, which in turn is
concatinated to another single quted string.
To make thsi clearer remember that the period (.) is the
concatination operator is PHP.
The quotes that are embeded in the strings are the double quotes
(")and the reason for them is that they are required by the html
that is being echoed out.
Finally, the single quotes around the 'first_name' are not embeded
in any string, they are there to make the string 'first_name' the key
(or index) to get thea appropriate value out of the $_POST array.
- Tom Z