Problems showing some special characters [closed]

1

My problem is that in a management panel you must show domains, users and passwords. The case is that the passwords have special caraacteres, among them < and > . And when it comes to showing everything between those characters, they are taken as HTML tags. Is there a function of PHP5 to show passwords literally?

    
asked by juank 02.10.2018 в 11:38
source

1 answer

6

The function you're looking for is htmlspecialchars() .

I show you its use with an example:

<?php

$password = "<123456>?.$<span>";

// No muestra el <span>
echo $password, "<br/>", PHP_EOL;

// Muestra todos los caracteres, incluso el <span>
echo htmlspecialchars($password), PHP_EOL;

Here is an example online: Example

    
answered by 02.10.2018 / 12:10
source