I am interested in removing 5 digits from back to front in the var_nums variable. I cannot specify which ones because they are obtained automatically. How can I achieve it?
$var_nums = "125469856554";
I am interested in removing 5 digits from back to front in the var_nums variable. I cannot specify which ones because they are obtained automatically. How can I achieve it?
$var_nums = "125469856554";
To remove the first 5 digits
To remove the last 5 digits
Here is the documentation for any questions: https://www.php.net/manual/es/function.substr.php
I hope it works, I remain at your orders.
Your query is about removing the last 5 digits and putting them in the front .
There are many ways to do it:
The function will take the back and front part to store them in the variables $numberBack and $numberForward respectively.
Now we print the value returned by the function move_digits($number)
The result: