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 | |
// ... Missile Command API called (malformed input) ... | |
$api_result = "{launch_override:true,msg:'abort'"; // <- notice the missing curly brace | |
$result = json_decode($api_result, true); | |
if ($result->launch_override) { | |
echo "Terminating launch sequence."; | |
exit(); | |
} |
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 | |
// ... Missile Command API called ... | |
$api_result = "{launch_override:true,msg:'abort'}"; | |
$result = json_decode($api_result, true); | |
if ($result->launch_override) { | |
echo "Terminating launch sequence."; | |
exit(); | |
} |
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
/** | |
* Encodes attachment in requested format. Returns an | |
* empty string on failure. | |
* @access private | |
* @return string | |
*/ | |
function EncodeFile ($path, $encoding = "base64") { | |
if(!@$fd = fopen($path, "rb")) | |
{ | |
$this->SetError($this->Lang("file_open") . $path); |
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
//////////////////////////////////////////////////// | |
// PHPMailer - PHP email class | |
// | |
// Class for sending email using either | |
// sendmail, PHP mail(), or SMTP. Methods are | |
// based upon the standard AspEmail(tm) classes. | |
// | |
// Copyright (C) 2001 - 2003 Brent R. Matzelle | |
// | |
// License: LGPL, see LICENSE |
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 | |
// Simple array of mixed keys and values | |
$arr = array( | |
0 => 'First', | |
1 => 'Second', | |
'Alpha' => 'Greek', | |
'FUN' => true, | |
'00' => 'Last', | |
0.328932 => 'test float', | |
32892.232 => 'test float 2' |
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 getPage() | |
{ | |
return $_SERVER['REQUEST_URI']; | |
} | |
$pages = array('' => 'index.php', 'home' => 'index.php', 'frequently-asked-questions' => 'faq.php', '404' => '404.php'); | |
$uri = getPage(); | |
$idx = array_key_exists($uri, $pages) ? $uri : '404'; |
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 getPage() | |
{ | |
return $_SERVER['REQUEST_URI']; | |
} | |
$pages = array('' => 'index.php', 'home' => 'index.php', 'frequently-asked-questions' => 'faq.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
$sale['email_contents'] = $email_template['reciept_email']; |
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 | |
// Simple array of mixed keys and values | |
$arr = array(0 => 'First', 1 => 'Second', 'Alpha' => 'Greek', 'FUN' => true, '00' => 'Last'); | |
$keys = array_keys($arr); | |
foreach ($keys as $key) { | |
echo "{$key} is " . gettype($key) . "\n"; | |
} | |
// Output: | |
// 0 is integer |
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 | |
// Simple array of mixed keys and values | |
$arr = array(0 => 'First', 1 => 'Second', 'Alpha' => 'Greek', 'FUN' => true, '0' => 'Last'); | |
$keys = array_keys($arr); | |
foreach ($keys as $key) { | |
echo "{$key} is " . gettype($key) . "\n"; | |
} | |
// Output: | |
// 0 is integer |