Write a PHP program to create a new string using three copies of the last two character of a given string of length atleast two
<?php function test($s1) { $last2 = substr($s1, strlen($s1) - 2); return $last2 . $last2 . $last2; } echo test("Hello")."\n"; echo test("Hi");
Sample Output:
lololo HiHiHi
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer