Jump to content

Recommended Posts

Let's say that this is an actually good illustration. I want to take a piece of displayed html and have the code for it layed out in a text box at the bottom of the page (I'm finding it hard to describe this in words so this paint image is the best I can do, sorry guys !!! :) )

 

Would this be a php maneuver, or is this done through other means?

 

 

picoh.jpg

Link to comment
https://forums.phpfreaks.com/topic/135958-solved-general-coding-question/
Share on other sites

Only other thing i can suggest is using maybe an iframe or ajax and then view-source:http://www.website.com using a regex to find certain bits you want which you would surround in either certain tags or comments.

 

I hope you realize that view-source: is just a browser thing to make lives easier, correct?

<?php
$html = <<<HTMLSTUFF
<html>
<head>
   <!-- header stuff here -->
</head>
<body>
   more blah blah blah
   <a href='http://www.ohtehblah.com'>blah!</a>
</body>
</html>
HTMLSTUFF;

echo $html;

// example 1
echo "<pre>";
echo htmlentities($html);
echo "</pre>";

// example 2
echo "<textarea cols = '80' rows = '10'>";
echo htmlentities($html);
echo "</textarea>";
?>

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.