- Forums
- PHP
- How To Change Text In To HTML
on this post webune is going to show you How To Change Text In To html [2048], Last Updated: Mon Jun 24, 2024
Webune
Sun Oct 11, 2009
0 Comments
474 Visits
hi, welcome to Webune Support Forums.
today we are going to show you how to convert text into hmtl code.
lets say for example we have this sentence:
"Webune Has The Best <Support>"
as you can see from our example, we need to change the quotes into html and the brackets<> here is the html code for each:
" = "
< = <
> = >
so if we want to change them, we can do it using PHP. you must have a website with PHP. if you dont have php this script will not work. you can sign up with us for PHP hosting. we have many options for every level of web hosting. from small to large business.
so to change our text into html we are going to use the htmlentities() function in php.
the best way to learn is to do it and see it action. so open a blank nopepad in your windows computer and copy and paste the following code:
PHP CODE:
<?php
$foo = htmlentities('"Webune Has The Best <Support>"');
echo 'Text Example: '.$foo.'<br><br>';
echo 'Now in HTML: '.htmlentities($foo).'<br>';
?>
now save the file as webune2544.php and upload to your PHP website, then open it with you browser from your URL..
exampl: http://www.example.com/webune2544.php
NOTE: replace example.com with your domain