Forums / Templates, Stylesheets, Page Layout / how do i force the code for additional images to detect only xxxx_01.jpg?

how do i force the code for additional images to detect only xxxx_01.jpg?

Views: 520

Results 1 to 2 of 2
25 Nov 2012, 6:15 AM
#1
weber avatar

weber

Zen Follower

Join Date:
Nov 2005
Posts:
157
Plugin Contributions:
0

how do i force the code for additional images to detect only xxxx_01.jpg?

in zen cart, additional images, which check
if(preg_match('/\Q' . $products_image_base . '\E/i', $file) == 1) {

it will return anything with your_name_xxxxxxx
however, i just want numbers only, such as your_name_1, your_name_02

how to modified the preg_match pattern?

26 Nov 2012, 1:40 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: how do i force the code for additional images to detect only xxxx_01.jpg?

Why do you want to restrict it to just numbers?
If there are other images displaying, why not just remove those, given that it sounds like you don't ever want them to display?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.