67 lines
1.3 KiB
PHP
67 lines
1.3 KiB
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");
|
|
|
|
$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);*/
|
|
|
|
require "table.php"; |