php - array_search not showing results with ftp_rawlist -
i'm trying search files uploaded or modified month in ftp server. tried ftp_rawlist()
store details files on server , used array_search()
search array rows contain name of month, it's not showing results, not error. ideas?
here's code:
$buff = ftp_rawlist($ftp_conn, '/'); // $buff contains (checked via var_dump()) // array(20) { // [0]=> string(64) "drwxr-xr-x 3 4664210 15000 4096 aug 19 15:09 .archived" // [1]=> string(66) "…" // } echo array_search("aug" ,$buff);
array_search
return identical matches, unless value "aug" , "aug", return no match.
additionally, array_search
only return 1 value, if work search part of string, first match returned if there multiple matching values.
to search array, use following code:
foreach ($buff $array_value) { if (strpos($array_value, "aug") !== false) { // found } }
Comments
Post a Comment