insert
query
For example:
INSERT INTO `topwords` (`id`, `word`, `frequency`, `deleted`) VALUES
(1, 'the', 22038615, 0),
(2, 'be', 12545825, 0)
...
2) Add SQL file in a public folder or App/someFolderForSQLFiles
3) Use this in seeder
$path = base_path('public\topwords.sql');
$sql = file_get_contents($path);
DB::unprepared($sql);
Or this:
$path = 'app/someFolderForSQLFiles/topwords.sql';
DB::unprepared(file_get_contents($path));
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
<?php
function get_cars($obj) {
if (!is_object($obj)) {
return false;
}
return $obj->cars;
}
$obj = new stdClass();
$obj->cars = array("Volvo", "BMW", "Audi");
var_dump(get_cars(null));
echo "<br>";
var_dump(get_cars($obj));
?>
<?php
$a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander");
print_r(array_keys($a));
?>
<?php
$a=array("Volvo"=>"XC90","BMW"=>"X5");
if (array_key_exists("Volvo",$a))
{
echo "Key exists!";
}
else
{
echo "Key does not exist!";
}
?>
<?php
$values = array(false, true, null, 'abc', '23', 23, '23.5', 23.5, '', ' ', '0', 0);
foreach ($values as $value) {
echo "is_string(";
var_export($value);
echo ") = ";
echo var_dump(is_string($value));
}
?>
<?php
$str = "Visit W3Schools";
$pattern = "/w3schools/i";
echo preg_match($pattern, $str);
?>
<?php
echo strpos("I love php, I love php too!","php");
?>
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland");
if (in_array("Glenn", $people))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>
<?php
$yes = array('this', 'is', 'an array');
echo is_array($yes) ? 'Array' : 'not an Array';
echo "\n";
$no = 'this is a string';
echo is_array($no) ? 'Array' : 'not an Array';
?>