php trim string length – How to Extract a Substring from a String?

php trim string length – Truncate a string to first n characters of a string and add three dots if any characters are removed

$user_line = substr($user_line,0,10).'...';

php trim string length

using substr() php, php trim string to length and print only some characters of a string in php.

substr(string,start,length)

php trim string to length

substr() php



//substr() function returns certain bits of a string 

php trim string to length

Example


php get first 5 characters of string

$result = substr("Welcome To Pakainfo.com free Download", 0, 5);

Php String Length

php get first character of string

$firstuser_lineCharacter = substr("Welcome", 0, 1);

take last four digits php

$newuser_line = substr($dynamicuser_line, -7);

I hope you get an idea about php trim string length.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment