note 110831 added to function.array-values

From: Date: Wed, 12 Dec 2012 18:03:14 +0000
Subject: note 110831 added to function.array-values
Groups: php.notes 
Request: Send a blank email to php-notes+get-192498@lists.php.net to get a copy of this message
If you are looking for a simple and hardcoded script to extract a single value of an array in ascending order, try this : <?php $a=scandir('mp3'); $total = count($a); $i=2; do { echo "Artiest = "; echo $a[$i]. "<br />"; $i=$i+1; } while ($i<=$total-1); ?> remark : the variable $i is set so that the first 2 entries of the array are skipped. These entries contains the values "." and ".." These values represent the root and the mp3 directories themselves and therefor most likely not wanted for use in your script. However, you can change it to any number you like as long as its value ddoesn´t not exceeds the total number of records in the array. Play with it and you´ll quickly understand this. ---- Server IP: 69.147.83.199 Probable Submitter: 72.52.91.2 (proxied: 81.71.76.58) ---- Manual Page -- http://php.net/manual/en/function.array-values.php Edit -- https://master.php.net/note/edit/110831 Del: integrated -- https://master.php.net/note/delete/110831/integrated Del: useless -- https://master.php.net/note/delete/110831/useless Del: bad code -- https://master.php.net/note/delete/110831/bad+code Del: spam -- https://master.php.net/note/delete/110831/spam Del: non-english -- https://master.php.net/note/delete/110831/non-english Del: in docs -- https://master.php.net/note/delete/110831/in+docs Del: other reasons-- https://master.php.net/note/delete/110831 Reject -- https://master.php.net/note/reject/110831 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#192498) next »