
<?php
/*
if (5==8){
	echo 'true';
	}
	else
	{
		      
		echo 'false';
		
	}
	
	$number1 = 10;
	$number1 = $number1 + 5;
echo "$number1";


	$number1 = 10;
	$number2 = 11;
	
	if ($number1 != $number2) {
		
    echo 'inside.';	
	}
	
	echo "<br>";
	$sum =10 + 20;
	echo $sum;
		echo "<br>";
	$num1 = 50;
	$num2 = 20;
	$num3 = 5;
    $result = ($num1 + $num2) /$num3;
       echo $result;
		echo "<br>";	 
	$num4 = 10;
		$num4 ++;
		echo 	$num4;
	
	echo "<br>";
	$num5 = 350;
	$upper = 1000;
	$lower =200;
	if ($num5 >= $lower && $num5 <= $upper ) {
		
		echo "ok";
	}

echo "<br>";
		
		$counter = 1;
		while ($counter <=10) {
		echo $counter. 'hello <br>';	
		$counter++;	
		}
	echo "<br>";
	$number2 = 20;
	function add ($num1, $number2){
		echo $num1+ $number2;
	}	
	add ($num1, $number2);
	
echo "<br>";
	
	function add ($number1, $number2){
    $result = $number1 + $number2;
	return $result;
	}	
  
	function divide($number1, $number2){
		   $result= $number1 / $number2;
		return $result;	
	}
	$sum = divide (add (5, 7), add (6, 2)); 
	echo $sum;
	
	echo "<br>";
	$user_ip = $_SERVER ['REMOTE_ADDR'];
	function echo_ip(){
		global $user_ip;
	$string = "your ip address is: $user_ip";
	echo $string; 
	}
	echo_ip();
	
echo "<br>";

	
	$string ="this is an example string";
	$string_word_count = str_word_count($string);
	echo $string_word_count;
		
	
	$food = array ('pasta', 'pizza', 'salad');
	print_r ($food) [1];
	
echo "<br>";
	$food = array ('healthy'=> 
	                      array ('salad' , 'vegetable'), 
						  'unhealthy' => 
						  array ('pizza' , 'pasta'));
					
		echo $food ['healthy'] [0];
echo "<br>";
	echo $food ['unhealthy'] [1];

	
	$food = array ('healthy'=> 
	                      array ('salad' , 'vegetable'), 
						  'unhealthy' => 
						  array ('pizza' , 'pasta'));
					foreach ($food as $element => $inner_array) {
						echo '<strong>' .$element. '</strong>'.'<br>'; 
						foreach ( $inner_array as $item){
							echo $item. '<br>';	
						}							
	}
*/	
?>



<h1>well come to barodi home bage</h1>
<?php
/*
$var1= 10;
$var2= 'hello';




$string = 'this is a string';
if (preg_match('/is/', $string)){
	echo 'match found';
} else {
	echo 'no match found';
}
*/?>
<?php
/*

function has_space($string) {
if (preg_match('/ /', $string)){
	return true;
} else {
	
	return false;
}
	
	
}
$string ='this doesn\'t have a space';
if (has_space($string)){
	
	echo 'has at least one space';
} else { 
echo 'has no space';
}







*/
?>
<?php
/*

$string = 'Barodi';
$string_length = strlen($string);
echo $string_length;
*/
?>
 <?php
 /*
 $string = 'i could be any case';
 $string_lower = strtolower ($string);
 $string_upper = strtoupper ($string);
 echo $string_upper;
*/
 ?>
<?php 
 /*<hr>
<form action ="index.php " method = "POST" >
 <textarea name = "user_input" rows = "6" cols = "30"><?php $user_input; ?>   </textarea ><br><br> 
<input type = "submit" value ="Submit"> 
</form>

//video number 49, 50.
$find = array ('barodi', 'mohamed', 'ali');
$replace = array ('b****i', 'm*****d', 'a*i');

if (isset ($_POST ['user_input'])&&! empty($_POST['user_input'])) {
   $user_input = $_POST['user_input'];
	$user_input_new = str_ireplace ($find, $replace, $user_input);
	echo $user_input_new;	
} 
*/
?>

<hr>
<form action ="index.php " method = "POST" >
 <textarea name = "user_input" rows = "6" cols = "30"><?php $user_input; ?>   </textarea ><br><br> 
<input type = "submit" value ="Submit"> 
</form>
<?PHP]
//video number 51



?>






















