jpratt Posted September 13, 2006 Share Posted September 13, 2006 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. Link to comment https://forums.phpfreaks.com/topic/20678-trim-off-first-12-characters-of-string/ Share on other sites More sharing options...
Destruction Posted September 13, 2006 Share Posted September 13, 2006 Have you looked at substr?[code]<?php$str = $_GET['str'];$trimmed = substr($str, 12);?>[/code]This should return anything after the first 12 characters.HTHDest Link to comment https://forums.phpfreaks.com/topic/20678-trim-off-first-12-characters-of-string/#findComment-91442 Share on other sites More sharing options...
kenrbnsn Posted September 13, 2006 Share Posted September 13, 2006 You need to use the [url=http://www.php.net/substr]substr()[/url] function. Ken Link to comment https://forums.phpfreaks.com/topic/20678-trim-off-first-12-characters-of-string/#findComment-91443 Share on other sites More sharing options...
jpratt Posted September 13, 2006 Author Share Posted September 13, 2006 Thanks, works great. Link to comment https://forums.phpfreaks.com/topic/20678-trim-off-first-12-characters-of-string/#findComment-91450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.