Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Created by PhpStorm.
* User: User
* Date: 29-Sep-15
* Time: 12:19
*/
class DB {
<?php
/**
* Created by PhpStorm.
* User: User
* Date: 24-Sep-15
* Time: 00:28
*/
namespace OOP_Homework;
<?php
/**
* Created by PhpStorm.
* User: User
* Date: 23-Sep-15
* Time: 17:58
*/
namespace OOP_Homework;
<?php
require_once '../vendor/fzaninotto/faker/src/autoload.php';
//include "AutoLoader.php"; //Conflict with Faker
include "classes/Person.php";
include "classes/Teacher.php";
include "classes/Student.php";
include "classes/Lecture.php";
for($i=0;$i<10;$i++){
<?php
/**
* Created by PhpStorm.
* User: Alex
* Date: 19-Sep-15
* Time: 12:35
*/
/**
* Reverses a given string without using the native function strrev(). First it splits the string into an array of
<?php
if($_POST){
$name = filter_input(INPUT_POST, "name", FILTER_DEFAULT);
$email = filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL);
if($name && $email){
setcookie("name", $name, time()+604800);
setcookie("email", $email, time()+604800);
}
<?php
$translations = array();
if(isset($_COOKIE['translations'])){
$translations = json_decode($_COOKIE['translations']);
}
?>
<!DOCTYPE html>
<html>
<head lang="en">
<?php
require_once "functions/pig_latin.php";
if($_POST){
if(isset($_COOKIE['translations'])){
$translations = json_decode($_COOKIE['translations']);
setcookie("translations", "", time()-3600);
}else{
$translations = array();
<?php
/**
* Created by PhpStorm.
* User: User
* Date: 20-Aug-15
* Time: 18:48
*/
$clean = array();
$clean['salary'] = 0;
<?php
/**
* Created by PhpStorm.
* User: User
* Date: 20-Aug-15
* Time: 16:41
*/
function bbcode_to_html($body){
$count = 0;//counter to be passed by reference to the preg_replace() function. This will be incremented every time there is a match.