Search
 
SCRIPT & CODE EXAMPLE
 

PHP

substr last 3 characters

<?php

$string = "testing string 123";

echo substr($string,-3); //this will give last 3 characters of the above string
// output "123"
echo substr($string,-5); //this will give last 5 characters of the above string
// output "g 123"
echo substr($string,5); //this will give first 5 characters of the above string
// output "testi"

?>
Comment

PREVIOUS NEXT
Code Example
Php :: create model and migration laravel 
Php :: reindex after post api magento 2 
Php :: eloquent firstorcreate 
Php :: cakephp group by count 
Php :: html windows logo 
Php :: laravel downgrade php version 
Php :: php command line check syntax errors 
Php :: change native password in phpmyadmin 
Php :: laravel query when 
Php :: Full text search laravel mongodb 
Php :: how to check page loading time in php 
Php :: php current page 
Php :: php const scope 
Php :: simple bindings laravel 
Php :: numberformater php format to k and m 
Php :: financial year calculation in php 
Php :: laravel How to include model attribute automatically 
Php :: PHP-cs-fixer: Executable Path Windows 
Php :: laravel query builder delete all 
Php :: how to get today week month ad year data in eloquent 
Php :: laravel make job command 
Php :: laravel hiding attributes JSON 
Php :: PHP substr — Return part of a string 
Php :: manual collection laravel 
Php :: CODEIGNITER codeigniter 4 auth 
Php :: phpmailer send email to multiple addresses 
Php :: php password_hash 
Php :: php/Laravel check if date is passed 
Php :: how to truncate all tables laravel 
Php :: spatie/laravel-activitylog display only changed data 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =