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 | |
class House { | |
public static function label() { | |
return "House"; | |
} | |
public function getChildLabel() { | |
return static::label(); | |
} |
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 | |
require_once "dbcon.php"; | |
$json = file_get_contents('php://input'); | |
$obj = json_decode($json, true); | |
$username = $obj['username']; | |
$password = $obj['password']; | |
$email = $obj['email']; | |
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
<html> | |
<head> | |
<title>White List</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<form action="" method="POST"> | |
<label>Choose your color:</label> | |
<select name="color"> |
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
<html> | |
<head> | |
<title>Black List</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<form action="" method="POST"> | |
<label>Choose your color:</label> | |
<select name="color"> |
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 | |
/* If we want to show some PHP code inside HTML page for showcase, example, etc., here is the way to do it */ | |
// Code we want to show inside HTML page | |
$code = ' | |
<?php | |
echo "Test code to be output with everything else"; | |
?>'; | |
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 | |
$MyFirstVariable = 'Mitchell'; //making of my first variable | |
$Mitchell = '$MyFirstVariable'; | |
echo "My first variable was named " , $Mitchell , "."; //Outputs My first variable was named $MyFirstVariable. | |
echo " The value of my variable was " , $MyFirstVariable , "."; //Outputs The value of my variable was Mitchell. | |
$empty = array(); //creates empty array | |
$array = array('Mitchell' , 'Laurie' , 'Fall semester 2020'); //creates an array with my firstname, lastname, and semester |
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 | |
$x=5; | |
$y=6; | |
$a=1; | |
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 | |
$movies = array( | |
array('Bad Boys For Life' , 'Comedy' , 'Mike Judge' ), | |
array('To Little' , 'Action' , 'Andy / Larry Wachowski' ), | |
array('Jumanji The Next Level' , 'Comedy / Adventure' , 'Sofia Coppola' ), | |
array('IP Man 4' , 'Action' , 'Ron Howard' ), | |
array('SpiderMan Far From Home' , 'Adventure' , 'Jared Hess' ) | |
); | |
echo '<table border="1">'; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Php Assignment</title> | |
<style type="text/css"> | |
.tblstyl{ | |
color: yellow; | |
background-color: purple; | |
width: 100px; | |
text-align: center; |
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 | |
function countPositivesSumNegatives(array $numbers) { | |
$result = array(); | |
$total = 0; | |
$i = 0; | |
if (!empty($numbers)) { | |
foreach($numbers as $number) { | |
if($number < 0) { | |
$total += $number; |
NewerOlder