View fiddle_062244.php
This file contains 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(); | |
} |
View fiddle_020347.php
This file contains 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']; | |
View fiddle_083546.php
This file contains 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"> |
View fiddle_038259.php
This file contains 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"> |
View fiddle_019123.php
This file contains 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"; | |
?>'; | |
View fiddle_015787.php
This file contains 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 |
View fiddle_018277.php
This file contains 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; | |
View fiddle_073001.php
This file contains 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">'; |
View fiddle_067521.php
This file contains 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; |
View fiddle_047807.php
This file contains 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