1
I have the following answer:
<<?php echo $valor->usu_id; ?>>
However, it is interpreted by the browser as TAG and not as return.
How do I make it return without being a tag? In this example, return <andrebaill>
1
I have the following answer:
<<?php echo $valor->usu_id; ?>>
However, it is interpreted by the browser as TAG and not as return.
How do I make it return without being a tag? In this example, return <andrebaill>
2
Use HTML entities like this:
<<?php echo $valor->usu_id; ?>>
A pure HTML example:
Vira tag: <br>
<foobar>
<hr>
É "visivel": <br>
<foobar>
List of HTML entities on W3.org: https://dev.w3.org/html5/html-author/charref
If the content comes from a variable in PHP (or bank) you can use htmlspecialchars
thus:
<?php $foobar = '<foobar>'; ?>
<?php echo htmlspecialchars($foobar); ?>
Note:
The difference of
htmlspecialchars
andhtmlentities
is that thehtmlspecialchars
only encodes characters that have some meaning for HTML, whereashtmlentities
encodes everything that has the equivalent in "HTML entities"
Note that there is a tag <xmp>
which may have the same effect, however is obsolete (although it still works):
<xmp><foobar></xmp>
Browser other questions tagged html
You are not signed in. Login or sign up in order to post.