How do you pull first 100 characters of a string in PHP

I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.

Is there a function that can do this easily?

For example:

$string1 = "I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.";
$string2 = 100charfunction($string1);
print $string2

To get:

I am looking for a way to pull the first 100 characters from a string vari

Answers


$small = substr($big, 0, 100);

For String Manipulation here is a page with a lot of function that might help you in your future work.


Need Your Help

WebView start url Android 4.4.3

android android-webview

We have a nexus 5 with the latest version of Android (4.4.3) and a hybrid web app running inside a webview.

Restricting column values in Pandas Pivot

python pandas

Let's say I have some data with an index mapped to key-value pairs like so:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.