Skip to content

Instantly share code, notes, and snippets.

@reidsneo
reidsneo / in_array_multi.php
Created February 25, 2021 07:33 — forked from ArneGockeln/in_array_multi.php
php recursive array search for needle. returns path of keys to value or false
<?php
// This function searches for needle inside of multidimensional array haystack
// Returns the path to the found element or false
function in_array_multi( $needle, array $haystack ) {
if ( ! is_array( $haystack ) ) return false;
foreach ( $haystack as $key => $value ) {
if ( $value == $needle ) {
return $key;
} else if ( is_array( $value ) ) {
@reidsneo
reidsneo / README.md
Created November 21, 2020 14:44 — forked from simenbrekken/README.md
Setting up a local wildcard DNS server

#Installation#

First you'll need [dnsmasq][1], assuming you're on OSX installation is simply:

brew install dnsmasq

#Configuration#

Add 127.0.0.1 to to the top of your DNS server list in your Network Configuration:

@reidsneo
reidsneo / Wrapper.php
Created August 18, 2020 07:41 — forked from krisanalfa/Wrapper.php
Tiny Guzzle Wrapper
<?php
namespace Alpha;
use GuzzleHttp\Client;
class Wrapper
{
protected static $client;