Skip to content

Instantly share code, notes, and snippets.

View gueff's full-sized avatar

Guido K.B.W. Üffing gueff

View GitHub Profile
<?php
/**
* ✔ pos. tested with Parsedown 1.7.4
*
* This allows usage of image dimensions this way:
* ![odyssee2001](http://example.com/Odyssey2001.png =100x100)
* ![odyssee2001](http://example.com/Odyssey2001.png =100x100 "Even with Title")
*
* @related
@devd123
devd123 / recursive function
Created April 14, 2017 10:43
Parent Child Tree PHP Recursion
public function getresultTree(array $elements, $parentId = 0) {
$branch = array();
foreach ($elements as $element) {
if ($element['parent_id'] == $parentId) {
$children = getresultTree($elements, $element['id']);
if ($children) {
<?php
/**
* @param string $sMarkup
* @return string
*/
function beautifyXml($sMarkup = '') : string
{
$oDOMDocument = new DOMDocument();
$oDOMDocument->preserveWhiteSpace = false;