php get first 5 characters of string
snippet in php

php get first 5 characters of string

user5580

$result = substr("Hello How are you", 0, 5); //first 5 chars "Hello"

php get first character of string

user922

$firstStringCharacter = substr("hello", 0, 1);

take last four digits php

user5132

$newstring = substr($dynamicstring, -7);