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 | |
/** | |
* Creates a multiplication table / column | |
* | |
* @param [number] $by - number to multiply by | |
* @param [number] $begin - number to begin the column | |
* @param [number] $end - number to end the column | |
* | |
* @author Hendrik Eduard Kuiper |
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 random_passwords($length,$count,$characters) { | |
// $length - the length of the generated password(s) | |
// $count - number of passwords to be generated | |
// $characters - types of characters to be used in the password | |
// define variables used within the function | |
$symbols = []; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Eze_JS event listeners</title> | |
<script> | |
function addListeners() { | |
if(window.addEventListener) { |
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
-- | |
-- You will see several spelling errors. | |
-- These are intentional. Whichever language you speak/use always make spelling mistakes!! | |
-- | |
CREATE DATABASE IF NOT EXISTS `8dCXCpnx!UT8U+dO=2` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; | |
USE `8dCXCpnx!UT8U+dO=2`; | |
-- Table structure for table `administators` | |
-- The Admin password is 7648edd7ddbd1ce2 |
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 | |
/* | |
* A random string generator to create a random string | |
* of any desired length. | |
*/ | |
function random_string_generator($length){ | |
$result = ""; | |
$chars = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!$%&*()_-+="; |
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 | |
/* | |
* Generate a secure password and hash it | |
* to insert into your Database. | |
*/ | |
$password = bin2hex(random_bytes(8)); | |
echo "password is => ", $password, " hash is => "; |
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 | |
/* | |
* Create Hashtags | |
*/ | |
$string = 'This is the #content the user #wrote'; | |
$explode = explode(' ', $string); | |
$hashtag = COUNT($explode); |
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 fibonacci($n) { | |
$current = 1; | |
$previous = 0; | |
for ($i = 0; $i < $n; $i++) { | |
yield $current; | |
$temporary = $current; | |
$current = $previous + $current; | |
$previous = $temporary; |
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 check_for_non_alpha_numeric($str) { | |
$reg = '/[^[:alnum:]$]/'; | |
preg_match_all($reg, $str, $matches, PREG_SET_ORDER, 0); | |
if($matches) { | |
print "<hr>oops, try again.<pre>"; | |
var_dump($matches); | |
} else { |
NewerOlder