Skip to content

Instantly share code, notes, and snippets.

View Najaf's full-sized avatar

Ali Najaf

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' type='text/css' href='style.css' media='screen' />
<script type='text/javascript' src='jquery.js'></script>
<title>Alis Fruity Milkshakes</title>
</head>
<body>
<div id='wrapper'>
<div id='header'>
<?php
function render($page, $params = array()) {
extract($params);
include "{$page}.php";
}
(1..100).each do |i|
print "Fizz" if i % 3 == 0
print "Buzz" if i % 5 == 0
print i.to_s unless i % 3 == 0 or i % 5 == 0
print "\n"
end
<?php
$address = new Address();
$address->name = 'John Smith';
$address->line2 = ... etc
<?php
$address = array(
'name' => 'John Smith',
'line1' => '1 Somewhere Road',
'line2' => 'Happytown',
'region' => 'Somewhere County',
'country' => 'United Kingstates'
'postcode' => '123 ABC'
);
<?php
class Song {
private $duration;
private $name;
//Getters/Setters
function setName( $name ) {
return $this->name;
}