$array = file ('path/to/file');
if ($array) {
foreach ($array as $value) {
$data = explode(';', $value);
// производите действия для записи
}
}
require_once('database.php');
use Illuminate\Database\Capsule\Manager as Capsule;
class Checkers {
protected static $tables = [
'dnsrec' => 'dns',
.... etc.
];
public function check ($userid,$id , $type,$what) {
$query = Capsule::table(self::$tables[$type]) ->where('unid' , $id);
if ($what==='belong') {
$result = $query->where('userid', $userid)->first();
} else if ($what==='exist') {
$result = $query->first();
}
if (is_empty($result)) {
return true;
}
return false;
}
}