Write a PHP script to get the last three characters of a string

  • برمجة بي اتش بي

Write a PHP script to get the last three characters of a string.

Sample String : 'rayy@example.com'

الأجوبة

<?php
$str1 = 'rayy@example.com';
echo substr($str1, -3)."\n";
?>

Sample Output:

com
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...