![]() |
Hey
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... |
PHP Code:
|
thanks man! I'll post a link to the gallery here once it's done.
|
Quote:
|
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 |
Oh, ok, you mean like chop off the .jpg or .gif?
|
Yep :)
|
Thanks! See? Even an old dog can learn new tricks. ;)
|
What if I want to display the first word that comes before a dash?
like: file-with-dashes.jpg = file |
PHP Code:
|
Code:
<?php |
www.php.net/is_dir function checks for directories :)
|
Yup I figured it out. I used the readdir function.
|
How do I get rid of those dots? Also how do I sort this alphabetically?
PHP Code:
. .. Ford Infiniti Mercedes BMW Nissan Volvo |
Well I did an extremely crude fix:
PHP Code:
|
The 2nd argument of str_replace can be blank. You can substitute the first argument with an empty string, instead of using an image tag (which makes no sense).
|
No if I put a space in the br's have effect, but if there is 0 pix images there is nothing to <br>
|
All times are GMT. The time now is 08:34 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:
|