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> | |
<?php if ($item == TRUE): ?> | |
<div id='test'> | |
<?php foreach ($items as $item): ?> | |
<?php echo 'foobar'; ?> | |
<?php endforeach; ?> | |
</div> | |
<?php endif; ?> | |
</html> |
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 | |
system("stty -icanon"); | |
define('LINE_RETURN', "\n"); | |
class Console { | |
// Input prompt | |
public static $pi = "\033[36m>>\033[37m "; |
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
<table border="0" cellpadding="0" style="font-family: 'Arial';"> | |
<tbody> | |
<tr> | |
<td style="border:none;border-right:solid #FABF8F 1.0pt;padding:.75pt 16.5pt .75pt .75pt"><img src="http://domusnova.is/img/signature.gif"></td> | |
<td style="border:none;border-right:solid #FABF8F 1.0pt;padding:.75pt 16.5pt .75pt 16.5pt"> | |
<p> | |
<span style="font-size:18.0pt;">Bóas Ragnar Bóason</span> | |
<br /> | |
<span style="font-size:10.0pt;color:#595959">Sölustjóri</span> | |
</p> |
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 | |
$total = 10000; | |
$count = 0; | |
$start = (float) array_sum(explode(' ',microtime())); | |
for($i = 0; $i <= $total; $i++) | |
{ |
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 defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* Handles all media the website will ever have to need. It minifies all | |
* javascript and stylesheets. Then it compresses every file to gzip and outputs | |
* it to the browser, if he accepts it. | |
* | |
* @package OpenTorrent | |
* @category Controllers | |
* @author Birkir R Gudjonsson <[email protected]> | |
* @copyright Copyright (c) 2010, Birkir R Gudjonsson |
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 input() | |
{ | |
$handle = fopen("php://stdin", "r"); | |
return fgets($handle); | |
} | |
function fetch($url = NULL) | |
{ | |
$ch = curl_init(); |
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 | |
$mysqli = mysqli_connect('localhost', 'user', 'pass', 'database'); | |
if (mysqli_connect_errno()) | |
{ | |
print('Gat ekki tengst.'); | |
} | |
if ($stmt = $mysqli->prepare('INSERT INTO `users` (`name`, `username`, `email`, `password`) VALUES (?, ?, ?, ?)')) |
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 | |
$insert = array( | |
'name' => 'John Doe', | |
'username' => 'john', | |
'email' => '[email protected]', | |
'password' => hash('sha256', 'password', TRUE) | |
); | |
$db = DB::insert('users') |
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 defined('SYSPATH')or die('No access'); | |
class Controller_Sites extends Controller_Template { | |
public function action_index() | |
{ | |
$sites = ORM::factory('site')->sites()->find_all(); | |
} | |
} |
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 | |
$gengi = array(); | |
$xml = file_get_contents('http://vefafgreidsla.tollur.is/tollalina/gengi/Innflutningur.aspx'); | |
$xml = new SimpleXMLElement(str_replace('xmlns="tollalinan/WS/Schema/DSGengi.xsd"', NULL, $xml)); | |
foreach ($xml->DSGengi->MyntOgGengi as $item) | |
{ | |
$gengi[strtolower($item->Mynt)] = (double) $item->Gengi; | |
} |
OlderNewer