PHP 8.4.24 Released!

Voting

: two minus one?
(Example: nine)

The Note You're Voting On

Cristianlf
15 years ago
I needed a function like lpad from oracle, or right from SQL
 then I use this code :

<?php
function right($string,$chars)
{
    $vright = substr($string, strlen($string)-$chars,$chars);
    return $vright;
    
}

    echo right('0r0j4152',4);
?>

Result: 
 4152
------------------------------------------------
This function is really simple, I just wanted to share, maybe helps someone out there.  

regards,

<< Back to user notes page

To Top