Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to escape html tags in php

/*  EXAMPLE:	<p>Bed & Breakfast</p>	-->	  <p>Bed &amp; Breakfast</p>  
    & 	&amp;
    " 	&quot; 				(unless ENT_NOQUOTES is set)
    ' 	&#039; or &apos; 	(ENT_QUOTES must be set)
    < 	&lt;
    > 	&gt;				*/

<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new; 					// <a href='test'>Test</a>
?>
Comment

PREVIOUS NEXT
Code Example
Php :: How to use php to set title 
Php :: php array_sum 
Php :: yii2 redirect with 301 
Php :: wordpress check shortcode exists 
Php :: php format datetime 
Php :: laravel permission denied storage log 
Php :: laravel makehidden 
Php :: laravel plural 
Php :: string to bool php 
Php :: php auto scoll page with output 
Php :: laravel get host with http 
Php :: include a page from another directory php 
Php :: remove html from string php 
Php :: install phpunit on ubuntu 18.04 
Php :: how to claer the input php 
Php :: header cross origin using php only for our domains and subdomain 
Php :: wordpress search code 
Php :: calcul age php datetime 
Php :: php iterate array 
Php :: ternary operator laravel blade 
Php :: yii2 activeform adding field placeholder 
Php :: laravel migrate only one table 
Php :: php loop through objects 
Php :: php get username from iis 
Php :: php str_replace multiple 
Php :: laravel-admin Model does not exists ! 
Php :: codeigniter set timezone 
Php :: php artisan preset react 
Php :: php while loop array 
Php :: open php ini from terminal 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =