This commit is contained in:
2024-05-24 13:52:03 +03:00
parent 9d8e759172
commit 5b3ea91ac5
3 changed files with 13 additions and 42 deletions

View File

@ -23,45 +23,20 @@ fclose($file);
$file = fopen($fileName, "r");
$fullArr = array();
$arrKey = array('surname', 'name', 'patronymic', 'dateOfBirth', 'gender', 'countryCode', 'phoneNumber', 'email');
$parsingArray = array();
while (!feof($file)) {
$str = fgets($file);
if(search($str, '/\b(иванов)\b/ui')){
$fullArr[] = $str;
/* $obj = new Information();
$obj->stringToParsingArray($str, $fullArr);*/
$array = array_combine($arrKey, explode(";", $str));
$obj = new Information();
$obj->load($array);
$parsingArray[] = $obj;
}
}
echo "<pre>";
print_r($fullArr);
//$arrKey = array('surname', 'name', 'patronymic', 'dateOfBirth', 'gender', 'countryCode', 'phoneNumber', 'email');
/*function fillArray($str, $arrKeys, $array): void
{
if($str){
$array = array_combine($arrKeys, explode(";", $str));
echo "<pre>";
print_r($array);
}
}*/
/*$strArray = explode(";", $str);
echo "<pre>";
print_r($strArray);*/
//$array = array_combine($arrKey, explode(";", $str));
/*echo "<pre>";
print_r($array);*/
// $array = array();
// fillArray($str, $arr, $array);
/*$obj = new Information();
$obj->load($array);
echo "<pre>";
print_r($obj);*/
print_r($parsingArray);
require "table.php";