102 lines
3.1 KiB
PHP
102 lines
3.1 KiB
PHP
<!-- Sie sehen unten 6 verschiedene Variablen. Diese sollen sie in eine Tabelle übertragen, die folgende Spaltennamen besitzt: Variablenname, Variablenwert, Gesetzt, Null, Leer, Typ, Zahl, String, Boolen. Füllen Sie dann die Zellen der Tabelle mit Hilfe der jeweiligen Funktionen mit Werten. -->
|
|
|
|
<?php
|
|
|
|
$var1 = "Hello";
|
|
$var2 = 856;
|
|
$var3 = false;
|
|
$var4 = null;
|
|
$var5;
|
|
$var6 = "";
|
|
|
|
//Code START
|
|
|
|
echo "<table>";
|
|
echo "<tr>";
|
|
echo "<th>Variablenname</th>";
|
|
echo "<th>Variablenwert</th>";
|
|
echo "<th>Gesetzt</th>";
|
|
echo "<th>Null</th>";
|
|
echo "<th>Leer</th>";
|
|
echo "<th>Typ</th>";
|
|
echo "<th>Zahl</th>";
|
|
echo "<th>String</th>";
|
|
echo "<th>Boolen</th>";
|
|
echo "</tr>";
|
|
|
|
echo "<tr>";
|
|
echo "<td>var1</td>";
|
|
echo "<td>$var1</td>";
|
|
echo "<td>".isset($var1)."</td>";
|
|
echo "<td>".is_null($var1)."</td>";
|
|
echo "<td>".(empty($var1) ? "TRUE" : "FALSE")."</td>";
|
|
echo "<td>".gettype($var1)."</td>";
|
|
echo "<td>".is_numeric($var1)."</td>";
|
|
echo "<td>".is_string($var1)."</td>";
|
|
echo "<td>".is_bool($var1)."</td>";
|
|
echo "</tr>";
|
|
|
|
echo "<tr>";
|
|
echo "<td>var2</td>";
|
|
echo "<td>$var2</td>";
|
|
echo "<td>".isset($var2)."</td>";
|
|
echo "<td>".is_null($var2)."</td>";
|
|
echo "<td>".(empty($var2) ? "TRUE" : "FALSE")."</td>";
|
|
echo "<td>".gettype($var2)."</td>";
|
|
echo "<td>".is_numeric($var2)."</td>";
|
|
echo "<td>".is_string($var2)."</td>";
|
|
echo "<td>".is_bool($var2)."</td>";
|
|
echo "</tr>";
|
|
echo "<tr>";
|
|
echo "<td>var3</td>";
|
|
echo "<td>$var3</td>";
|
|
echo "<td>".isset($var3)."</td>";
|
|
echo "<td>".is_null($var3)."</td>";
|
|
echo "<td>".(empty($var3) ? "TRUE" : "FALSE")."</td>";
|
|
echo "<td>".gettype($var3)."</td>";
|
|
echo "<td>".is_numeric($var3)."</td>";
|
|
echo "<td>".is_string($var3)."</td>";
|
|
echo "<td>".is_bool($var3)."</td>";
|
|
echo "</tr>";
|
|
echo "<tr>";
|
|
echo "<td>var4</td>";
|
|
echo "<td>$var4</td>";
|
|
echo "<td>".isset($var4)."</td>";
|
|
echo "<td>".is_null($var4)."</td>";
|
|
echo "<td>".(empty($var4) ? "TRUE" : "FALSE")."</td>";
|
|
echo "<td>".gettype($var4)."</td>";
|
|
echo "<td>".is_numeric($var4)."</td>";
|
|
echo "<td>".is_string($var4)."</td>";
|
|
echo "<td>".is_bool($var4)."</td>";
|
|
echo "</tr>";
|
|
echo "<tr>";
|
|
echo "<td>var5</td>";
|
|
echo "<td>$var5</td>";
|
|
echo "<td>".isset($var5)."</td>";
|
|
echo "<td>".is_null($var5)."</td>";
|
|
echo "<td>".(empty($var5) ? "TRUE" : "FALSE")."</td>";
|
|
echo "<td>".gettype($var5)."</td>";
|
|
echo "<td>".is_numeric($var5)."</td>";
|
|
echo "<td>".is_string($var5)."</td>";
|
|
echo "<td>".is_bool($var5)."</td>";
|
|
echo "</tr>";
|
|
echo "<tr>";
|
|
echo "<td>var6</td>";
|
|
echo "<td>$var6</td>";
|
|
echo "<td>".isset($var6)."</td>";
|
|
echo "<td>".is_null($var6)."</td>";
|
|
echo "<td>".(empty($var6) ? "TRUE" : "FALSE")."</td>";
|
|
echo "<td>".gettype($var6)."</td>";
|
|
echo "<td>".is_numeric($var6)."</td>";
|
|
echo "<td>".is_string($var6)."</td>";
|
|
echo "<td>".is_bool($var6)."</td>";
|
|
echo "</tr>";
|
|
|
|
echo "</table>";
|
|
|
|
|
|
//Code ENDE
|
|
|
|
|
|
|
|
?>
|