Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Get the Last Character of a String in PHP

phpCopy<?php  
$string = "This is a string";

$lastChar = $string[-1];
echo "The last char of the string is $lastChar.";
?>
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Get #Last #Character #String #PHP
ADD COMMENT
Topic
Name
6+6 =