User Tools

Site Tools


uphp:functions:htmlspecialchars

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:htmlspecialchars [2017/04/11 11:22]
jeff
uphp:functions:htmlspecialchars [2021/09/13 05:57] (current)
Line 7: Line 7:
 ====Description==== ====Description====
  
-<well size="sm"> +<well size="sm"><html>
-<html>+
 <span style="font-size:125%;color:green">string <span style="font-size:125%;color:green">string
-<span style="color:black"> +<span style="color:black">htmlspecialchars (
-</html> +
-[[htmlspecialchars]] ( +
-<html>+
 <span style="color:green">string <span style="color:green">string
 <span style="color:blue">$data <span style="color:blue">$data
 <span style="color:black">) <span style="color:black">)
-</html> +</html></well>
-</well>+
  
 Certain characters have special significance in HTML, and should be represented by HTML entities if they are to be displayed in a browser "as is." This function returns a string with these conversions made. Certain characters have special significance in HTML, and should be represented by HTML entities if they are to be displayed in a browser "as is." This function returns a string with these conversions made.
Line 24: Line 19:
 ====Parameter==== ====Parameter====
  
-<html><b><span style="color:blue">$data<span style="color:black"></b></html>:  <html><b><span style="color:green">String<span style="color:black"></b></html> to be formatted+<html><b><span style="color:blue">$data<span style="color:black"></b>:  <b><span style="color:green">String<span style="color:black"></b> to be formatted</html>
  
-====Return Value====+====Return Values====
  
-<html><b><span style="color:green">String<span style="color:black"></b></html> with certain characters replaced. The translations performed are:+<html><b><span style="color:green">String<span style="color:black"></b> with certain characters replaced. The translations performed are:</html>
  
 ^CHARACTER^NAME^TRANSLATED (HTML ENTITY)^ ^CHARACTER^NAME^TRANSLATED (HTML ENTITY)^
-|&|ampersand|&amp;+|&|ampersand|''&amp;''
-|"|double quote|&quot;+|"|double quote|''&quot;''
-|'|single quote|&#039;+|'|single quote|''&#039;''
-|<|less than|&lt;+|<|less than|''&lt;''
-|>|greater than|&gt;|+|>|greater than|''&gt;''|
  
 ====Examples==== ====Examples====
Line 53: Line 48:
 </code> </code>
  
-Without conversion by [[htmlspecialchars]] the browser would instead display the hyperlink <html><span style="color:blue"></html>__Test__<html><span style="color:black"></html>+(Without conversion by [[htmlspecialchars]] the browser would instead display the hyperlink <html><span style="color:blue"></html>__Test__<html><span style="color:black"></html>)
  
-**Read the file index.cgi line by line and format the output for display on the browser screen:**+===Read the file index.cgi line by line and format the output for display on the browser screen===
  
 <code php> <code php>
uphp/functions/htmlspecialchars.1491909771.txt.gz · Last modified: 2021/09/13 05:56 (external edit)