Q:

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

0

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

Sample String : 'rayy@example.com'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

Sample Output:

com

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now