Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get first character of string

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

first name of string php

$words = explode(" ", $string);

$firstname = $words[0];
$lastname = $words[1];
$third_word = $words[2];
Comment

php get first word of string

$value = "Test me more";
echo strtok($value, " "); // Test
Comment

get first word from string php

function getFirstWord($string)
    {
        $arr = explode(' ', trim($string));
        return isset($arr[0]) ? $arr[0] : $string;
    }
Comment

php get first character of each word

if(!function_exists('get_avatar')){
    function get_avatar($str){
        $acronym;
        $word;
        $words = preg_split("/(s|-|.)/", $str);
        foreach($words as $w) {
            $acronym .= substr($w,0,1);
        }
        $word = $word . $acronym ;
        return $word;
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel 8 validation required if another field is not null 
Php :: php var_export to string 
Php :: php laravel intervention base64 to image save 
Php :: php switch statement 
Php :: word press get home page id 
Php :: add two numbers as string in php 
Php :: session cakephp 
Php :: php uppercase first letter 
Php :: laravel collection prepend 
Php :: how to make-migrations in laravel 
Php :: enque scripts from plugin 
Php :: php absolute value 
Php :: mysql secure 
Php :: push key and value in laravel 
Php :: php regex string contains coringa 
Php :: laravel 8 routes namespace 
Php :: laravel group by with where clause 
Php :: laravel date format 
Php :: page break in dompdf 
Php :: xampp to test on mobile 
Php :: php hash 
Php :: $conn php 
Php :: window.location javascript php 
Php :: get user role in symfony 
Php :: laravel default authentication redirectTo 
Php :: delete model laravel 
Php :: laravel where and or condition 
Php :: laravel create new request 
Php :: php file extension 
Php :: php group multidimensional array by value 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =