|
Posted by John Rappold on 08/21/06 18:15
Hi,
I could really use some fast help on this. I have two arrays.
The first array is created from the following:
$dirn = substr($file, 0, 6);
$birn = substr($file, 7, 6);
$fdate = substr($file, 14, 8);
$period = substr($file, 23, 5);
$cat = substr($file, 29, 3);
$fields = array($dirn, $birn, $fdate, $period, $cat);
Here's the second array:
$badchars = array("-", "_");
What I want to do is search through the $fields array and find any
occurences of the characters in the $badchars array.
I tried to use an example from some comments on the PHP manual strpos page,
but I can't get this to work:
$i=0;
$offset=0
$pos=false;
if ($pos === false) {
$pos = strpos($fields, $badchars[$i], $offset);
echo "File Passed.<br> ";
$i++;
} else {
rename($curpath, $badpath);
echo "Bad file Moved<br>";
$i++;
}TIA for help on this.
Navigation:
[Reply to this message]
|