Skip to content

Instantly share code, notes, and snippets.

@griffiths
Last active October 13, 2015 14:37
Show Gist options
  • Save griffiths/4210359 to your computer and use it in GitHub Desktop.
Save griffiths/4210359 to your computer and use it in GitHub Desktop.
PHP Sample for Core Lab Interaction
<?php
$requestedstat = $_REQUEST["stat"];
// Variable
$stat = "Average salary subjects in a September study offered a fictional woman applying for a U.S. university laboratory position: $26,508";
$stats = Array(
"Average salary subjects in a September study offered a fictional woman applying for a U.S. university laboratory position: $26,508",
"Amount Massachusetts has been ordered to pay for the sex-reassignment surgery of an inmate serving life in prison : $23,000",
"Minimum funds smuggled out of China in the past two decades by officials fleeing the country : $120,000,000",
"Chance that a crime committed in New York City in 2012 was one of these thefts : 1 in 7",
"Percentage increase since 2008 in the portion of Americans who call themselves “lower-class” : 28",
"Number of rental bicycles vandalized in wealthy areas of Paris in September in the name of class warfare : 50",
"Percentage change in the past five years in the share of new U.S. cars sold to people between ages 18 and 34 : –42",
"Portion of New York City taxis driven by women : 1/100"
);
//print_r($stats);
?>
<!DOCTYPE html>
<html>
<head>
<title>*** PHP #2***</title>
</head>
<body>
<?php
//$stats[2] = "New Value";
//shuffle($stats);
echo $stats[$requestedstat];
//$randomstat = rand(0, (count($stats)-1));
//echo $stats[$randomstat];
for ($blah = 0; $blah < count($stats); $blah++) {
//echo "<div>";
//echo $stats[$blah];
//echo "</div>";
};
?>
<a href="php_lab.php?stat=0">See Stat 0</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment