Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Please rewrite this html line of code into php echo statement

Question posted by: princelindie (Newbie) on May 16th, 2008 02:32 PM
Please write this html code into php echo statement.

<a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
hsriat's Avatar
hsriat
Expert
1,447 Posts
May 16th, 2008
03:06 PM
#2

Re: Please rewrite this html line of code into php echo statement
Quote:
Originally Posted by princelindie
Please write this html code into php echo statement.

<a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>



For any character which is reserved in PHP, you can use a backslash (\) to escape it.

So when we have to include a quote within a string, use backslash just before it.
Code: ( text )
  1. echo "<a href=\"javascript:ajaxpage('test.htm', 'contentarea');\">test</a>";


May be you get confused due to single quotes. But there no need to escape single quotes when being included in double quoted. (and vice versa)

Reply
princelindie's Avatar
princelindie
Newbie
28 Posts
May 16th, 2008
04:25 PM
#3

Re: Please rewrite this html line of code into php echo statement
Thanks .. that work..

Reply
ronverdonk's Avatar
ronverdonk
Moderator
4,138 Posts
May 16th, 2008
11:27 PM
#4

Re: Please rewrite this html line of code into php echo statement
Quote:
Originally Posted by princelindie
Please write this html code into php echo statement.

<a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>
Maybe a basic PHP course would come in handy?

Ronald
__________________
RTFM is an almost extinct art form.

Reply
Reply
Not the answer you were looking for? Post your question . . .
178,103 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top PHP Forum Contributors