Created
September 25, 2017 16:44
-
-
Save alherd-by/cfd22edcaf1c2fca9d611093b646a34a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = 'string'; | |
$double = 12.12345; | |
$array = ['foo', 'bar']; | |
$a = 555; | |
$b = 'ZZZ'; | |
var_dump(@($a + $b)); | |
var_dump($a . $b); | |
$staff = [ | |
[ | |
'name' => 'Иванов', | |
'email' => '[email protected]', | |
'phone' => '111-22-33' | |
], | |
[ | |
'name' => 'Петров', | |
'email' => '[email protected]', | |
'phone' => '112-24-36,' | |
], | |
[ | |
'name' => 'Сидоров', | |
'email' => '[email protected]', | |
'phone' => '113-25-37' | |
] | |
]; | |
$temp = [1, 2, 'A', 3.764, 34, 'B', 12]; | |
$temp = array_filter($temp, function ($value) { | |
return is_numeric($value); | |
}); | |
var_dump($temp); | |
echo '<table style="width: 300px">'; | |
$n = 0; | |
$red = 0x00; | |
$green = 0x00; | |
$blue = 0x00; | |
foreach (range(0, 1000) as $value) { | |
$red++; | |
$green++; | |
$blue++; | |
if ($red == 256) { | |
$red = 0; | |
$green = 0; | |
$blue = 0; | |
} | |
$colorValue = $red < 16 | |
? "#0" . dechex($red) . "0" . dechex($green) . "0" . dechex($blue) | |
: "#" . dechex($red) . dechex($green) . dechex($blue); | |
echo sprintf('<tr bgcolor="%s">', $colorValue); | |
for ($td = 1; $td <= 3; $td++) { | |
echo '<td>'; | |
if ($td == 1) { | |
echo $n; | |
$n++; | |
} | |
echo "</td>"; | |
} | |
echo "</tr>"; | |
} | |
echo '</table>'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment