GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP function to truncate a string... (https://gfy.com/showthread.php?t=443498)

Smut 03-13-2005 11:39 AM

PHP function to truncate a string...
 
Can someone please let me know which function I should be looking for to truncate a variable string to a set number of characters?

Ex. $string="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

function to truncate("$string", 5);
echo function to truncate(); //Would output "ABCDE"

Any assistance is appreciated.

Thanks

Darth Vader 03-13-2005 11:41 AM

I find your lack of truncated strings disturbing.

StuartD 03-13-2005 11:42 AM

substr ( string string, int start [, int length] )

StickyFinger 03-13-2005 11:47 AM

More info on it.
http://us4.php.net/manual/en/function.substr.php


All times are GMT -7. The time now is 01:21 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123