Page 1 of 1

Echoing an apostrophe in a variable...

Posted: Sat May 18, 2002 8:42 am
by Hebbs
I cant quite get my head around this one.

I have a variable that is a name with an apostrophe in eg O'Grady.

When I echo the value ($g_last) within the script generally its OK,

when I try the following in a normal table I only get the O returned:

Code: Select all

<TD>Surname:</TD>
<TD><INPUT TYPE='text' NAME='surname' VALUE='<?php echo("$g_last") ?>' SIZE='40' MAXLENGTH='20' READONLY></TD>
Maybe its just the late hour.....

Hebbs

I think it must be the hour...

Posted: Sat May 18, 2002 8:47 am
by Hebbs
I no sooner posted the bl**dy thing and relased it was all in the quotes.

Replaced the single quotes of the html with doubles and fixed it.

Oh the shame! :oops:

Hebbs