Вопрос по string, php – Как я могу получить последние 7 символов строки PHP?

219

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

$dynamicstring = "2490slkj409slk5409els";
$newstring = some_function($dynamicstring);
echo "The new string is: " . $newstring;

Error: User Rate Limit Exceeded

The new string is: 5409els
php.net/manual/en/function.substr.php PeeHaa
Error: User Rate Limit Exceeded Engin Yapici
Error: User Rate Limit Exceededquestion identified as a dupError: User Rate Limit Exceeded Asaph
Error: User Rate Limit Exceeded twigg
Error: User Rate Limit Exceededsigh LeonardChallis

Ваш Ответ

4   ответа
69

$newstring = substr($dynamicstring, -7);
Error: User Rate Limit Exceeded
7

Error: User Rate Limit Exceeded

$newstring = substr($dynamicstring, -7);

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

$newstring = (strlen($dynamicstring)>7)?substr($dynamicstring, -7):"message";

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
10

    $str='Ne zaman seni düşünsem';
    echo substr($str,-7) . ' <strong>is not equal to</strong> ' . mb_substr($str,-7,null,'UTF-8') ;

482

Error: User Rate Limit Exceededsubstr()Error: User Rate Limit Exceeded

$newstring = substr($dynamicstring, -7);

Error: User Rate Limit ExceededError: User Rate Limit Exceeded:

string substr ( string $string , int $start [, int $length ] )

If start is negative, the returned string will start at the start'th character from the end of string.

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded

Похожие вопросы