Kmspico Download | Official KMS Activator Website [New Version 2024] Fast and Easy Converter YouTube to MP3 Online KMSAuto Net Activator Download 2024 Immediate Byte Pro Neoprofit AI Blacksprut without borders. Discover new shopping opportunities here where each link is an entrance to a world ruled by anonymity and freedom.

How Can I Get the Last Character of a String in PHP?

Hello friends Today, through this tutorial, I will tell you how to get the last character from the any string by php. So let’s go.

Extract Last character from String Using PHP, Fetch Last Character from String by PHP Program

It is very easy to get his last character from string via php. You are given below in a very easy way. You can get the last character of string by adding this code to your file.

get-last-character-string.php

<?php 
$string = 'This is a string';
$lastCharacter = substr($string, -1);
echo "The last character of the string is $lastCharacter.";
?>