/    Sign up×
Community /Pin to ProfileBookmark

HTML convert to & from PHP: print "<html>n";

I posted this in javascript but there where no takers.

Maybe PHP is the way to go. The appeal of javascript was the the converter could be used localy on the users machine.

anyway here it is….what do you guys think?

[QUOTE]

I hade an idea for a handy script and I thought javascript could do it. I have looked on the net for something like this but could only fine an app that converted HTML to PHP. It was called “Hixus HTML Converter” and can be found here: [URL=http://hixus.com ]http://hixus.com [/URL] ….very handy but cannot convet back to HTML.
So I was hopping someone would have the time or know of a script that does this:

Take the HTML code:

[code=php]
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>My Site</title>
</head>
<body>
<p>Line1</p>
<p>Line2</p>
<p>Line3</p>
</body>
</html>
[/code]

And convert it to this:

[code=php]
print “<html>n”;
print “<head>n”;
print “<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>n”;
print “<title>My Site</title>n”;
print “</head>n”;
print “<body>n”;
print “<p>Line1</p>n”;
print “<p>Line2</p>n”;
print “<p>Line3</p>n”;
print “</body>n”;
print “</html>n”;
[/code]

And then have the option to convert back the other way.

I may even be a nice idea to have an option to use either “print” or “echo” in the PHP code.

It looks like an easy thing to do, for someone with the skills that is.

what I see in my head is two text boxes; HTML and PHP and a convert back and forth button or buttons.

I would like to also invite anyone to add there comments to this idea, Inprove it, offer any other functions that may be cool.

Hey….for all I know this may allready exist….But I couldn’t find it.

Cheers
Chris

[/QUOTE]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ermauJul 13.2004 — Not sure about your idea, but you definatley want some better conversion then that, that php code is terrible. Something like this is better:
[code=php]
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>My Site</title>
</head>
<body>
<p>Line1</p>
<p>Line2</p>
<p>Line3</p>
</body>
</html>';
[/code]
Copy linkTweet thisAlerts:
@AdamGundryJul 13.2004 — Just out of interest, why would anyone want to do this? There's little point in echoing out all that content through PHP - you could just include the content in the file, without needing the echo.

To convert back, you could just evaluate the PHP.

Of course, it's possible I'm missing the point entirely, in which case I'd like to understand what you are trying to achieve.

Adam
×

Success!

Help @cybercampbell spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...