Jump to content

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

Edited by redarrow
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.