Hiden Full Name Code using php Example Advika K** S***
Publish: 30 March 2024, 6:30 am IST | Views: 124
इस कोड को Apply करने से यह होगा की, Middle and Last Name का शुरू अक्षर दिखाई देगा और बांकी **** स्टार में बदल जायेगा
echo "<tr>";
// Get the first three characters of the middle name
$middle_letters = mb_substr($row["middle_name"], 0, 1, 'UTF-8');
// Get the first three characters of the last name
$last_letters = mb_substr($row["last_name"], 0, 1, 'UTF-8');
// Replace all characters except the first three with asterisks for middle name
$masked_middle_name = $middle_letters . str_repeat('*', max(0, mb_strlen($row["middle_name"]) - 1));
// Replace all characters except the first three with asterisks for last name
$masked_last_name = $last_letters . str_repeat('*', max(0, mb_strlen($row["last_name"]) - 1));
// Generate HTML code
echo "<td colspan='2' class='names'><a href='/profile/" . $row["username"] . "'>" . $row["first_name"] . " " . $masked_middle_name . " " . $masked_last_name . "</a> <img src='../img/name-privacy.png' width='20px' height='20px' title='Only Paid Member Allow Full Name'/></td>";
echo "</tr>";
Categories: Uncategorized