PHP, putting a looping variable from a foreach loop into a new array -


i have loop:

$dir = 'url/dir/dir/';  $images_array = glob($dir.'*.jpg');  foreach ($images_array $image) {      $image = str_replace($dir, '', $image);    }   

i want save $image variables new array. how possible?

$dir = 'url/dir/dir/';  $images_array = glob($dir.'*.jpg');   $images = array();  foreach ($images_array $image) {      $images[] = str_replace($dir, '', $image);    }  var_dump($images); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -