Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
phpfiddle / fiddle_058721.php
Created August 23, 2018 20:18
[ Posted by Stuart Westgate ] Practice Php Class
<?php
class HumanClass
{
public function __construct($firstName = 'Unknown', $lastName = 'Unknown', $sex = 'Unknown', $age = 0)
{
echo 'My name is ' . $this->firstName($firstName) . ' ' . $this->lastName($lastName) . ' I\'m ' . $this->sex($sex) . ' and ' . $this->age($age) . ' years old.';
}
public function firstName(string $fName)
{
@phpfiddle
phpfiddle / fiddle_023172.php
Created August 9, 2018 14:35
[ Posted by Shawna ] Hello World github:gist
<?php
echo "Hello World!";
?>
@phpfiddle
phpfiddle / fiddle_043848.php
Created July 31, 2018 18:45
[ Posted by AmericanLaw ] Discord traffic stop callout
<?php
//https://discordapp.com/api/webhooks/473908899423191061/wOmWGcIB9m9YjCJYO6KR4PrthRxxNdxFf2HCk1PrRtbwwDic8jAVIPehLLKFLWI2AKVZ
$curl = curl_init("https://discordapp.com/api/webhooks/473908899423191061/wOmWGcIB9m9YjCJYO6KR4PrthRxxNdxFf2HCk1PrRtbwwDic8jAVIPehLLKFLWI2AKVZ");
curl_setopt($curl,CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(array("content" => "All units be advides, vehicle accident located in Westover gas. x2 vehicles involved. Timeout, 14:01")));
echo curl_exec($curl);
@phpfiddle
phpfiddle / fiddle_014568.php
Created July 27, 2018 10:03
[ Posted by Alexds ] populate assign location field
<!-- THIS POPULATES THE "Assign this art item to:" select box -->
<?php
function my_post_object_query( $args, $field, $post_id ) {
//query locations available only to that logged user
$args = array(
'post_type' => 'krohne_location',
'author' => get_current_user_id()
@phpfiddle
phpfiddle / fiddle_048079.php
Created July 17, 2018 06:59
[ Posted by Muhammadali ] Code for asif
<?php
$months = array(
1 => 'Jan',
2 => 'Feb',
3 => 'March',
4 => 'April',
5 => 'May',
6 => 'June',
7 => 'July',
);
@phpfiddle
phpfiddle / fiddle_063130.php
Created July 16, 2018 23:56
[ Posted by TrapenokVictor ] CometQL query example
<?php
$short_connect = new mysqli("app.comet-server.ru", "15", "lPXBFPqNg3f661JcegBY0N0dPXqUBdHXqj2cHf04PZgLHxT6z55e20ozojvMRvB8", "CometQL_v1");
$sql = "show status";
//result is boolean for query other than SELECT, SHOW, DESCRIBE and EXPLAIN
$result = $short_connect->query($sql);
if (($result) && ($result->num_rows > 0))
@phpfiddle
phpfiddle / fiddle_049668.php
Created July 16, 2018 23:53
[ Posted by TrapenokVictor ] CometQL example
<?php
$short_connect = new mysqli("app.comet-server.ru", "15", "lPXBFPqNg3f661JcegBY0N0dPXqUBdHXqj2cHf04PZgLHxT6z55e20ozojvMRvB8", "CometQL_v1");
$sql = "show status";
//result is boolean for query other than SELECT, SHOW, DESCRIBE and EXPLAIN
$result = $short_connect->query($sql);
if (($result) && ($result->num_rows > 0))
@phpfiddle
phpfiddle / fiddle_036399.php
Created July 13, 2018 00:40
[ Posted by Jumito Empresarial ] la primera noticia
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
@phpfiddle
phpfiddle / fiddle_086911.php
Created July 8, 2018 04:34
[ Posted by Tutorials Class ] testing description
<?php
echo "dfdd";
?>
@phpfiddle
phpfiddle / fiddle_092431.php
Created June 29, 2018 17:54
[ Posted by Eric Moore ] Just an experiment
<?php
echo __DIR__ . '/../';
?>