“HTML PHP PHP” Kod odpowiedzi

HTML PHP 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>
?>
VasteMonde

HTML PHP PHP

$string = "This is testing message "ETC" ";
htmlspecialchars($string, ENT_COMPAT)

Znaki specjalne w PHP

function removeSpecialChar($string) 
		{
			$string = strtolower($string);
			$string = preg_replace('/[^\da-z ]/i', '', $string);// Removes special chars.
			$string = str_replace(' ', '-', $string); // Replaces all spaces with underscore.
			return strtolower($string);
		}
Nilesh

PHP Otrzymuj HTML z znakami specjalnymi

$source = 'url of page with text with special characters';
$html = file_get_contents($source,0);
$html = mb_convert_encoding($html, 'UTF-8', mb_detect_encoding($html, 'UTF-8, ISO-8859-1', true));
Handsome Horse

Odpowiedzi podobne do “HTML PHP PHP”

Pytania podobne do “HTML PHP PHP”

Więcej pokrewnych odpowiedzi na “HTML PHP PHP” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu