Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $categories = array( 'sugar' => 'proionta/sugar/',
- 'metropolitan' => 'proionta/metropolitan/',
- 'interior' => 'proionta/interior/',
- 'glamour' => 'proionta/glamour/',
- );
- $keyword = trim($_GET['search']); // kovei ta kena apo arxh k telos
- // $keyword = strtolower($keyword); // ta metatrepei ola se mikra
- $keyword = preg_replace('/\s\s+/','*', $keyword);
- $keyword = explode("*", $keyword); // spaei to searchstring se array
- $image_found=false;
- $cat = $_GET['category'];
- $folder = $categories[$cat];
- foreach ($keyword as $key=>$file) {
- $images = glob($folder . "*" .$file. "*.*");
- foreach($images as $image) {
- echo json_encode($images);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement