Jump to content

Recommended Posts

comments!

 

<?php
I do stuff!
// I don't do stuff
/* I don't do stuff either! */
# I don't do stuff either, but my usage is much less common, I'd use the two above me.
?>

 

at least I think that's what you're asking...

 

Just occured: maybe you mean how do you echo php tags without parsing?

 

you could do

 

<php

^ looks like <?php outside of these code tags.

 

>

^ looks like > outside of these code tags.

 

or you could do

echo '
<?php
// code
?>
';

Link to comment
https://forums.phpfreaks.com/topic/124592-php-viewing/#findComment-643508
Share on other sites

My company has a few programs that transfer PHP code from one server to another using the include function. When it is included (using the full http address), the included file generates and echoes php code like this (this is a sample of the code inside the included file):

 

<?php

echo "<?php\n\n";

?>

more PHP code here... blah blah blah...

<?php

echo "\n?>";

 

The problem with this is that it doesn't show up on the page, you have to view the source to see it. So, you could try adding the <pre></pre> tags around it.

Link to comment
https://forums.phpfreaks.com/topic/124592-php-viewing/#findComment-643510
Share on other sites

its easy, your problem is your using echo which places text into hml code. and by defalut if html see's a tag it dosn't understand it hides everything in between it.

 

the way around this problem is useing the html codes for < and >

 

your script would be this: echo "<?php blah ?>"

which = <?php blah ?>

 

i found a converter at

http://www.plus2net.com/html_tutorial/tags-page.php

Link to comment
https://forums.phpfreaks.com/topic/124592-php-viewing/#findComment-643547
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.