![]() |
Truncate Variable
I have searched far and wide but can not find the answer xD
ok, so, how do i truncate (trim) characters off a string so it could have been x characters before but is 10 now? Regards, Nick. |
<a href="http://uk.php.net/substr" target="_blank">substr()</a>
|
so:
PHP Code:
is there an if so if it is more than x characers then do this and do this eg: PHP Code:
|
Yes (but no quotes needed around $str).
|
ok but what about the second bit?
|
Second bit ?
|
PHP Code:
|
Quote:
PHP Code:
And here is a list of all php string functions, which could come in handy: http://us2.php.net/manual/en/ref.strings.php |
thanks :)
ok so i have: PHP Code:
|
You have to assign the substr to something.
$var = substr(.....) |
All times are GMT. The time now is 05:02 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|