2024-05-20 14:40:53 +03:00
|
|
|
<?php
|
2024-05-21 11:53:40 +03:00
|
|
|
|
|
|
|
namespace src;
|
|
|
|
|
|
|
|
use Information;
|
|
|
|
|
|
|
|
require_once "src/Information.php";
|
2024-05-24 13:04:27 +03:00
|
|
|
require_once "Search.php";
|
2024-05-20 15:11:17 +03:00
|
|
|
|
2024-05-21 17:06:42 +03:00
|
|
|
$fileName = "Information.txt";
|
|
|
|
$fileModeOpen = "a";
|
2024-05-20 15:11:17 +03:00
|
|
|
|
2024-05-21 17:06:42 +03:00
|
|
|
$fullInformation = new Information();
|
|
|
|
$fullInformation->load($_REQUEST);
|
2024-05-20 15:11:17 +03:00
|
|
|
|
2024-05-21 17:06:42 +03:00
|
|
|
echo "<pre>";
|
|
|
|
print_r($fullInformation);
|
|
|
|
$string = $fullInformation->toString();
|
2024-05-20 15:11:17 +03:00
|
|
|
|
2024-05-21 17:06:42 +03:00
|
|
|
$file = fopen($fileName, $fileModeOpen);
|
|
|
|
fwrite($file, $string);
|
2024-05-21 11:53:40 +03:00
|
|
|
fclose($file);
|
2024-05-21 17:06:42 +03:00
|
|
|
|
2024-05-24 13:04:27 +03:00
|
|
|
$file = fopen($fileName, "r");
|
2024-05-22 14:29:38 +03:00
|
|
|
|
2024-05-24 13:04:27 +03:00
|
|
|
$fullArr = array();
|
|
|
|
|
|
|
|
while (!feof($file)) {
|
|
|
|
$str = fgets($file);
|
|
|
|
if(search($str, '/\b(иванов)\b/ui')){
|
|
|
|
$fullArr[] = $str;
|
|
|
|
/* $obj = new Information();
|
|
|
|
$obj->stringToParsingArray($str, $fullArr);*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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);*/
|
2024-05-22 14:29:38 +03:00
|
|
|
|
2024-05-21 11:53:40 +03:00
|
|
|
require "table.php";
|