Javascript and php

From: Date: Sun, 07 Nov 2004 10:44:33 +0000
Subject: Javascript and php
Groups: php.general 
Request: Send a blank email to php-general+get-201414@lists.php.net to get a copy of this message
Hey all, Hope some of you also work on sundays :) I have a little javascript which displays a images (with previous / next thing) Now, i populate the javascript array with an php array: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin NewImg = new Array ( <?php while($row = mysql_fetch_object($result)){ echo "\"".$row->picture_url."\","; } ?> "../pictures/7_stripper3.jpg", "../pictures/7_stripper2.jpg" ); var ImgNum = 0; var ImgLength = NewImg.length - 1; ... </script> As you can see i echo the url of the picture. After each picture url there needs to be a ',' But not after the last picture. At this moment all pictures have the ',' after there url, even the last one. Any way to determine if the url is the url of the last picture and thus not printing a ',' behind that last one? Thx in advance, Reinhart _____ Reinhart Viane <mailto:rv@domos.be> rv@domos.be Domos || D-Studio Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01 -- fax +32 15 43 25 26 STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies.

« previous php.general (#201414) next »