Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

image naming (with spaces?)

Featured Replies

Hi all

 

I've built this photo site - www.ingridvekemans.com - from PHP and Javascript. The images are stored in a directory called 'Portfolio' and their info is stored in the database. My question is, how bad is it that the image names contain spaces? For example, an image name might be 'Two lions hunting.jpg'. It all works fine, but should it be 'Two_lions_hunting.jpg'? Or with hyphens?

 

Thanks!

From a practical perspective it usually won't make a difference. However your pages may fail to validate.

 

If for some reason you are unable to use hyphens or underscores instead of spaces when naming the files, you can use PHP's rawurlencode function to replace the spaces with %20, e.g:

 

<?php echo rawurlencode('my file name.jpg'); ?>

 

outputs:

 

my%20file%20name.jpg

  • Author

thanks both

 

It does all work at the moment, but I want it to be as good as possible. I think a few hours' PHP can put in underscores, but before I do that, can I ask one more question? The site has only been online for a few weeks and Google's image bot hasn't swung by yet. If and when it does, do you know if there's any advantage/disadvantage to having spaces or underscores? I've read through the Google info but haven't found anything related...

 

Gordon.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.