Jump to content

Archived

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

jpratt

trim off first 12 characters of string

Recommended Posts

I have a string varible containing about 20-30 characters. I neet to trim off the first 12 characters of the string variable. I have found a half dozen trim functions but none that do what i want. Does someone know what does this? its probably easy, just need a function or something.

Share this post


Link to post
Share on other sites
Have you looked at substr?

[code]
<?php
$str = $_GET['str'];
$trimmed = substr($str, 12);
?>
[/code]

This should return anything after the first 12 characters.

HTH

Dest

Share this post


Link to post
Share on other sites
You need to use the [url=http://www.php.net/substr]substr()[/url] function.

Ken

Share this post


Link to post
Share on other sites

×

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.