Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //images can be the following:
  2.  
  3. classic-stable-bevan-white.png
  4. classic-stable-blake-white.png
  5. heritage-stable-arlington.png
  6. heritage-stable-amersham.png
  7.  
  8. //My Problem
  9.  
  10. I need to replace anything with -white.png on the end, with just.png
  11. So classic-stable-bevan-white.png -> classic-stable-bevan.png
  12.  
  13. Anything without -white.png needs to have *.png appended
  14. So heritage-stable-amersham.png -> heritage-stable-amersham*.png
  15.  
  16. My code so far is:
  17.  
  18. strtolower(str_replace('.png','*.png',(str_replace(' ', '-', 'http://localhost/test/uploads/doors/scaled_'.$door->getImage1()))));