Jump to content

what going on please help preg_replace.


redarrow

Recommended Posts

<?php


// image written like my_name_is(1).jpg

$dirname = "kenai_river_fishing_images/";
$images = glob($dirname."*");
 $img=preg_replace('/[\(\)]+/','',$images);
foreach($img as $image) {
echo '<img src="'.$image.'" /><br />';
}


?>

the image files are in this format.

// image written like my_name_is(1).jpg

so i used the above code to get rid of the ( <<< )<<<< signs

now the image says this

kenai_river_fishing 1.JPG

as you can see there gaps so the images wont show what do i do

 

cheers.

Link to comment
https://forums.phpfreaks.com/topic/275554-what-going-on-please-help-preg_replace/
Share on other sites

<?php


// image written like my_name_is(1).jpg

$dirname = "kenai_river_fishing_images/";
$images = glob($dirname."*");
 $imgs=preg_replace('/[\(\)]+/','',($images));
 $imgss = preg_replace('/\s+/', '', $imgs);
foreach($imgss as $image) {
echo '<img src="'.$image.'" /><br />';
}


?>

still not working even thu the problam fixed

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.