string - Replace first and last digit with * in php -


i want replace 1st , last digit of number series *. such have

$number = 123435987345735372;  

i want such

*535738753957353*  

like this?

$number = 123435987345735372;  $new_number = substr($number, 1, -1); $new_number = "*".$new_number."*"; echo"original number: $number<br>new number: $new_number"; 

like norbert van nobelen said, check out manual @ php.net


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -