You can simply hide and show the last digit numbers with jQuery php and css.

Here is the script to hide and show the last 4 digit of the string

echo "Hello World";
$no = "+97152432XXXX";
$hide = substr($no, -4);
$shono = substr($no, 0, -4);
echo $hide;
<script type="text/javascript" 
<link rel="stylesheet" type="text/css" 
<div id="number" data-last="<?php echo $hide ?>">
<?php echo $shono; ?><span>show</span></div>
$('#number').click(function() {
 $(this).find('span').text( $(this).data('last') );

Leave a Reply

Your email address will not be published. Required fields are marked *