PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I convert relevant characters in a string to HTML entities?


Use the htmlentities function like this:

<?php
$mystring 
"I said <ignore me then!>you <b>are a little bit</b> whack!";
echo 
htmlentities($mystring);
?>


Run it and see what happens!



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

How do I turn a string into an array?

How do I check if a string contains HTML?

How can I repeat a string several times?

How do I find the position of a letter in a string in PHP?

What is the difference between print and echo?



Custom Search