FormClasses/info.php
2024-05-24 13:52:03 +03:00

42 lines
886 B
PHP

<?php
namespace src;
use Information;
require_once "src/Information.php";
require_once "Search.php";
$fileName = "Information.txt";
$fileModeOpen = "a";
$fullInformation = new Information();
$fullInformation->load($_REQUEST);
echo "<pre>";
print_r($fullInformation);
$string = $fullInformation->toString();
$file = fopen($fileName, $fileModeOpen);
fwrite($file, $string);
fclose($file);
$file = fopen($fileName, "r");
$arrKey = array('surname', 'name', 'patronymic', 'dateOfBirth', 'gender', 'countryCode', 'phoneNumber', 'email');
$parsingArray = array();
while (!feof($file)) {
$str = fgets($file);
if(search($str, '/\b(иванов)\b/ui')){
$array = array_combine($arrKey, explode(";", $str));
$obj = new Information();
$obj->load($array);
$parsingArray[] = $obj;
}
}
echo "<pre>";
print_r($parsingArray);
require "table.php";