I have the code and I need to replace hex colors code to real color in PHP.
<?php
$host = "localhost";
$username = "root";
$password = "passhere";
$dbName = "userpanel";
$con = new mysqli($host,$username,$password,$dbName);
echo '
<!DOCTYPE html>
<html>
<body>
<div class="header">
RANKINGBOARD BRASIL RACING
</div>
<div class="table">
<table border="1">
<tr class="title" align="center">
<td>Ranking</td>
<td>Nome</td>
<td>Pontos</td>
<td>Cash</td>
<td>Mapas Jogados</td>
</tr>
';
$getAccountData = "SELECT * FROM tableUserpanel order by CAST(points as SIGNED) desc";
$i =1;
$result= mysqli_query($con,$getAccountData);
while ( $dataMTA = mysqli_fetch_array($result,MYSQLI_ASSOC))
{
echo '
<tr align="center">
<td>'.$i++.'</td>
<td>'.$dataMTA["playerName"].'</td>
<td>'.$dataMTA["points"].'</td>
<td>'.$dataMTA["cash"].'</td>
<td>'.$dataMTA["mapsPlayed"].'</td>
</tr>
';
}
echo '
</table>
</div>
</body>
</html>
';
?>
When the PHP query the database, playerName comes with HEX colors like |#Ly#FFFFFFca#0080ffN^ ... I need to convert the hex colors to <span style='color:HEX-GOES-HERE'>playerName here</span>
, how can I do that?
I'm trying for a few days.