PHP IN_Array function
All,
Working on a script to convert online search results download files into a MySQL .sql input file. Code is below. I have no problem scanning the directory with the files and the 1st foreach loop eliminates all non .html files and .html~ edit files. The "$filr = file($s_path.$fval);" statement correctly loads the file into an array for processing, showing the contents correctly displayed by the print_r statement. What is not working are the "in_array" statements so only the "get_flat" function is being called. The 3 different files downloaded are either table, div or flat-file display source. The 3 different functions exist, because"
First time for me using in_array and not sure if it is looking for an entire element such as: Code:
$ray[1] = 'table' Code:
$f_ray = scandir ( $s_path ); Cheers! TBNK |
All,
According to: https://stackoverflow.com/questions/...l-string-match There has to be this function: Code:
function array_search_partial($arr, $keyword) { Code:
function fnd_raysubstr ( $myval, $myray ) { Cheers! TBNK |
All,
That function worked just fine. PHP should have a command/function that actually does this natively. Where do I post it as a suggestion? Cheers! TBNK |
All times are GMT -5. The time now is 02:53 AM. |