![]() |
How do i set maximum characters?
IS that very hard to do?
I was trying to incorporate that in the follwing script: PHP Code:
I know it has something to do with: PHP Code:
But haven't got a clue how to combine that.... Can you help me out? |
little more detail would be good. Max characters for what, subject?
|
Sorry i forgot to mention that, yes the subject, in this case: $row["title"] But i haven't got a clue how yet. So if you could help that would be great
|
I have got my pencil and paper ready, how do i do this?
|
My fingers are getting cramped holding the pencil :)
Nobody knows how? |
Are you saying that you want a string to be no longer than a certain length?
I use a small addition like this in my forums to shrink usernames to show no more than 20 characters in the thread lists. Taking that as an example, you could do this: PHP Code:
Does that make any sense? heh |
Yes thats exactly what i wanted. Thanks!
So my string is this: $row["title"] So the code for me would be like this?: if (strlen($row["title"]) > 20) $row["title"] = substr($row["title"], 0, 17) . "..."; I am doing something wrong i guess, because the above example doesn't work... Argh! |
Let me give you the complete code:
------------------------- $result = mysql_query("SELECT title, threadid, dateline FROM thread WHERE forumid NOT IN ('10','16')ORDER BY dateline DESC LIMIT 40"); while($row = mysql_fetch_assoc($result)) { echo ".$row["title"]."\r\n"; } ------------------------- I hope this helps |
All times are GMT. The time now is 06:33 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:
|