Search the Community
Showing results for tags 'array result to string'.
-
Hello: I would like to request an opinion so maybe I can find the reason which I am not being able to see for the following. I am using an array that will organize the content of a directory in the oldest to newest order, once it is ordered, display it's content. So far, so good, where I find my self stumped is when I want to send the array result to a csv file for record keeping. I am getting the word "Array" instead of the file name,... What am I doing wrong? I hope someone can assist me in understanding what am I doing wrong. Thanks... Hiroshi T <?php $files = glob( './images/*.*' ); array_multisort( array_map( 'filectime', $files ), SORT_NUMERIC, SORT_ASC, $files ); echo '<html xmlns="http://www.w3.org/1999/xhtml"> <head> <link href="styles.css" rel="stylesheet" type="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Test Site</title> </head> <body> <div id="container"> <div id="formcontainer"> <form method="POST"> Picture Count: <input type="text" name="pcount"><br> <input type="submit" value="Submit"> </div> <!-- End of form Container--> <div id="imgcontainer"> <div id="imgframe"> <iframe src="'.$files[0].'" width="775" height="580" scrolling="no" frameborder="0"> </div> <!-- End of Image frame --> </div> <!-- End of Image Container --> </div> <!-- End of Container ID --> </body> </html>'; //$count = _POST["pcount"]; $imageDB = "imageDB.csv"; $DateStamp = date("m-d-Y"); $TimeStamp = date("H:i.s"); $openDB = fopen($imageDB, 'a') or die("Cannot update Database!"); $Data2appnd = "$files,$count,$DateStamp,$TimeStamp.\n"; fwrite($openDB,$Data2appnd); fclose($opendDB); ?>