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 characters to HTML entities using PHP?


If you want to do this, then it will come as no surprise that you use the HTMLentities function, which works as follows:

<?php
$address 
"www.food.com?blah=this and that&blah2=done";

echo 
HTMLentities($address);
//www.food.com?blah=this and that&amp;blah2=done
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More strings PHP Questions

What is the difference between join and implode in PHP?

How do I fetch the meta tags from a webpage using PHP?

How do I add commas easily to a string of numbers?

How do I find the ASCII value of a string character?

How do I format the output of a string?



Custom Search