Answers for "php get first letter od string in variable"

PHP
14

php get first character of string

$firstStringCharacter = substr("hello", 0, 1);
Posted by: Guest on October-19-2019
1

get first word from string php

function getFirstWord($string)
    {
        $arr = explode(' ', trim($string));
        return isset($arr[0]) ? $arr[0] : $string;
    }
Posted by: Guest on February-26-2021

Code answers related to "php get first letter od string in variable"

Browse Popular Code Answers by Language