, , .
, , Apache/Google, , , implode/explode; split/join; , .
, , , .
, , , -, , , , , , , / .
:
(pseudocode)
<?php
$images_path = "";
if($image = mysql_fetch_array($images)) {
$images_path .= $image['FILE_NAME'];
}
while($image = mysql_fetch_array($images)) {
$images_path .= ',' . $image['FILE_NAME'];
}
$images_array = explode(",", $images_path);
?>
Switch it from append to comma when there are several. Now you will never have to remove the extra comma or execute any destructive command. It looks very much like making proof, you build the base case, and then build the base.
source
share