bradgrafelman wrote:What do you mean?
$file = array(0 =>'hi');
echo $file[0][0]; // outputs: h
So it will work arrays!
Yes, if we know how many dimensions ( which is often the case, for sure )
But try your code with this array, bradgrafelman
<?php
$file = array(
array( 0 => 'hi their', 1 => 'buy buy my friend' ),
array( 0 => 'toeday heillo', 1 => 'morrow goodbye' )
);
echo $file[0][0]; // outputs: ????
My statement was:
$file[0] will not work with arrays
Think it is still true. ... at least it will not always return 1 character.
And this was what I wanted to say.
On the subject of this topic and in this context
it will work when readdir(),
as filnames are only simple strings, not arrays
===========================================
Here is my nice coding suggestion, again:
<?php
// Test while using readdir( $dir )
if ( $file[0] != "." ) {
// if first char of filename is not = '.'
// then include and add filename $file in Array List
// Will exclude [ '.' and '..' and '.htaccess' ] from your directory list
}
?>
===========================================
Regards
halojoy
🙂