Giddy Rob Posted April 21, 2008 Share Posted April 21, 2008 Hi, I know there is a php function, which allows you to specify how many characters you would like to display from the contents of a variable but i cant for the life of me remember what it is. Could someone please jog my memory cheers Link to comment https://forums.phpfreaks.com/topic/102181-function-for-displaying-for-example-the-first-20-chars-of-a-variable/ Share on other sites More sharing options...
micah1701 Posted April 21, 2008 Share Posted April 21, 2008 substr() echo substr('abcdef', 0, 4); // returns: abcd Link to comment https://forums.phpfreaks.com/topic/102181-function-for-displaying-for-example-the-first-20-chars-of-a-variable/#findComment-523060 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 Yeah, it's substr(). Someone beat me to it. *Grumble* Link to comment https://forums.phpfreaks.com/topic/102181-function-for-displaying-for-example-the-first-20-chars-of-a-variable/#findComment-523062 Share on other sites More sharing options...
Giddy Rob Posted April 21, 2008 Author Share Posted April 21, 2008 Thats the one! Cheers Link to comment https://forums.phpfreaks.com/topic/102181-function-for-displaying-for-example-the-first-20-chars-of-a-variable/#findComment-523064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.