php - var_dump outputting string('**') "array" -


i using foreach loop , var_dump var_dump following code outputs strange. how rid of pre-prended sring() , quotation marks?

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

output:

string(51) "image1.jpg,image2.jpg,image3.jpg,image4.jpg"

that's var_dump - prints datatype , length. if want output string use

echo implode(',', $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 ) -