print or store '<?php' tags

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bilibytes
    New Member
    • Jun 2008
    • 128

    #1

    print or store '<?php' tags

    Hi,

    I am wondering how to print '<?php'

    when y try or to store '<?php' string or to print it, there is no output

    i think this is or a php.ini directive or a httpd.conf one

    does someone know how to make that possible?


    thank you very much

    bilibytes
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Printing "<?php" into your HTML would make it invalid. < has special meaning in HTML and XML documents and using it to try to show the < symbol would cause a parse error.

    If you want to display that symbol in a HTML or XML page, then you should use the HTML replacement for it: &lt;

    Like, for example, if you wanted to print: "1 < 2", then you would print: "1 &lt; 2".

    You could also try running the string through the htmlentites function. That should convert it so it can be put into a HTML document without causing errors.
    Last edited by Atli; Dec 1 '08, 03:12 AM. Reason: Added some detail

    Comment

    • bilibytes
      New Member
      • Jun 2008
      • 128

      #3
      Thank you Atli, but the problem is from the server side.

      if it was a browser problem, when i read source code, the <?php should be written there and it is not...

      i will dig deeper into it, thanks any way

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, bilibytes.

        What's your code look like?

        Comment

        • greninm
          New Member
          • Apr 2010
          • 1

          #5
          print or store '&lt;?php' tags

          make sure you close off the tag

          <?php

          contents

          ?>

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by greninm
            make sure you close off the tag

            <?php

            contents

            ?>
            How would that remedy the problem?

            Comment

            Working...