View Single Post
  #1 (permalink)  
Old May 9th, 2006, 09:21
jimz jimz is offline
Reputable Member
Join Date: Feb 2006
Location: London
Age: 25
Posts: 100
Thanks: 0
Thanked 1 Time in 1 Post
Question better way to write this?

Hi,

Is there a way to write this without writing $key every time??? I tried $key == 'description' || 'includes'.... etc... but it dosen't work.

Code: Select all
} elseif (empty($value) && $key == 'description' || $key == 'includes' || $key == 'frameSize' || $key =='jumpWeight' || $key =='packedCarton' || $key == 'weight' || $key =='description2' || $key == 'thumb' || $key == 'large') {
It's being used in a class, so everything after $key == will be a variable passed from another script.

Thanks for your help!
Jim.
Reply With Quote