PHP Script To Take Some Of The Characters In The Title Of Sentence Automatically
In this article I want to write about how take some of the characters in the title of sentence use PHP script.
You can type the PHP script like that:
<?php
$text='this is a text to test';
echo substr($text,0,10).'...';?>
Information:
$text : is the variable that contain the text that you want to set the long of the text.
this is a text to test : is the text that you want to set the long of the text. You can type anything on there.
substr($text,0,10).'...': script to set the long of the text. It means take the 10 character on contain the variable $text. After that I add ...
The display like that:
You can type the PHP script like that:
<?php
$text='this is a text to test';
echo substr($text,0,10).'...';?>
Information:
$text : is the variable that contain the text that you want to set the long of the text.
this is a text to test : is the text that you want to set the long of the text. You can type anything on there.
substr($text,0,10).'...': script to set the long of the text. It means take the 10 character on contain the variable $text. After that I add ...
The display like that:
Happy Trying.
No comments