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 question (https://gfy.com/showthread.php?t=489986)

aztecvision 07-08-2005 03:38 PM

php question
 
How do you trim a variable's value to allways display a certain amount of characters, no matter how long the original varialbe may be?

Example:
$var1 = "123456789";
I need to only display the first 6 characters "123456"; basically hidding 789

woj 07-08-2005 03:39 PM

echo substr($var1,0,6);

??

aztecvision 07-08-2005 03:42 PM

Thanks! I owe you a beer!

MickeyG 07-08-2005 03:53 PM

next time try google, seriously you can find anything you want to know regarding php on there. I must use it a million times a day :)


All times are GMT -7. The time now is 02:24 PM.

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