write this:
if ($photo == "photo1") $pic = "Photo 1"; if ($photo == "photo2") $pic = "Photo 2"; if ($photo == "photo3") $pic = "Photo 3"; if ($photo == "photo4") $pic = "Photo 4"; if ($photo == "photo5") $pic = "Photo 5"; if ($photo == "photo6") $pic = "Photo 6";
Form radio variable being processed to use as text
Regular expressions are usually the best way to parse a string (in this case, to extract the number):
if (preg_match('/^photo(\\d+)$/', $photo, $matches)) { $pic = 'Photo '.$matches[1]; }
Thanks, it worked. I'm a novice and I'll have to look up what all of the shorthand means.