Jump to content

[SOLVED] Limiting number of characters in a string...


cgm225

Recommended Posts

If I have a long string of text in a variable, how can I "trim" the text down to a specific number of characters?

 

So for example, if I have:

 

$string = "This is a string";

 

and I just want the first four characters of the string, so just "This", how would I do that?

 

 

Thank you in advance!

cgm225

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.