Please rewrite this html line of code into php echo statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • princelindie
    New Member
    • Feb 2008
    • 28

    #1

    Please rewrite this html line of code into php echo statement

    Please write this html code into php echo statement.

    <a href="javascrip t:ajaxpage('tes t.htm', 'contentarea'); ">test</a>
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by princelindie
    Please write this html code into php echo statement.

    <a href="javascrip t:ajaxpage('tes t.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.
    [php]echo "<a href=\"javascri pt:ajaxpage('te st.htm', 'contentarea'); \">test</a>";[/php]

    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)

    Comment

    • princelindie
      New Member
      • Feb 2008
      • 28

      #3
      Thanks .. that work..

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Originally posted by princelindie
        Please write this html code into php echo statement.

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

        Ronald

        Comment

        Working...