<?

// stripslashes, addslashes, trim, print, print_r, echo, heredoc

$s = "   abc 	\n";

$u1 = trim($s);
echo "u1=\"$u1\"", "<br>\n";

$u2 = ltrim($s); // l for left
echo "u2=\"$u2\"", "<br>\n";

$u3 = rtrim($s); // r for right
echo "u3=\"$u3\"", "<br>\n";
echo "==================<br>";
// trim($s,"\n");

$s = "abC $2 deF// abaB";
$s = "marY simpsoN";

echo strlen($s), "<br>\n";

echo $s[2], "<BR>\n";

$t1 = strtoupper($s);
echo $t1, "<br>\n";

$t2 = strtolower($s);
echo $t2, "<br>\n";

$t3 = ucwords($s);
echo $t3, "<br>\n";

$t4 = ucwords(strtolower($s));
echo $t4, "<br>\n";

$t5 = ucfirst($s);
echo $t5, "<br>\n";

$s = <<< begin
<html><head><title>My Homepage</title></head>
<body>
<h1>Homepage of SUNY Fredonia</h1>
<BR>
Fredonia, NY
</body></html>
begin;

echo "<br>==<br>", $s, "<br>==t1==<br>\n";

$t1 = strip_tags($s);
echo $t1, "<BR>\n";

echo "<br>==t2==<br>\n";

$t2 = strip_tags($s,"<BR><h1><title>");
echo $t2, "<BR>";
echo  "<br>==<br>\n";

$m = get_meta_tags("http://www.cs.fredonia.edu/abu-jeib");
echo $m['author'], "<br>\n"; // keywords, description
echo $m[author], "<br>\n";

$k1 = 12.0;
$k2 = 12;
$k3 = "12";
$k4 = 12.00;

if ($k1 == $k2)
	echo "Yes1<br>\n";
else
	echo "No1<br>\n";
if ($k1 === $k2)
        echo "Yes2<br>\n";
else
	echo "No2<br>\n";
if ($k2 == $k3)
        echo "Yes3<br>\n";
else
        echo "No3<br>\n";
if ($k2 === $k3)
        echo "Yes4<br>\n";
else
        echo "No4<br>\n";

if ($k1 == $k4)
        echo "Yes5<br>\n";
else
        echo "No5<br>\n";
if ($k1 === $k4)
        echo "Yes6<br>\n";
else
        echo "No6<br>\n";

$s = "abc abC Abc";
echo "s = $s, <br>";
echo substr($s,1,2), "<br>"; 
echo substr($s,1), "<br>";
echo substr_count($s,"ab"), "<br>";
echo strrev($s), "<br>";
echo strpos($s,"ab"), "<br>";
echo strrpos($s,"abm"), "<br>";

?>
