The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I am currently making a gallery and have come a long way.
What I want to do now is: $title=$name where $name is file-with-dashes.jpg Now I want $title to be $name with dashes replaced with spaces and .jpg removed. I have shortened text before but never chopped off the ending... |
|
#2
|
||||
|
||||
|
PHP Code:
|
|
#3
|
|||
|
|||
|
thanks man! I'll post a link to the gallery here once it's done.
|
|
#4
|
||||
|
||||
|
Quote:
|
|
#5
|
||||
|
||||
|
The 0 is the start position and the -4 is the end position, ie chop 4 characters off the end.
http://uk.php.net/substr |
|
#6
|
||||
|
||||
|
Oh, ok, you mean like chop off the .jpg or .gif?
|
|
#7
|
||||
|
||||
|
Yep
|
|
#8
|
||||
|
||||
|
Thanks! See? Even an old dog can learn new tricks.
|
|
#9
|
|||
|
|||
|
What if I want to display the first word that comes before a dash?
like: file-with-dashes.jpg = file |
|
#10
|
||||
|
||||
|
PHP Code:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|