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 reverseLinkedList($l){ | |
if($l == null){ | |
return $l; | |
} | |
$reverse = clone $l; | |
$reverse->next = null; |
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
/* | |
Debug function for Javascript like var_dump in PHP: | |
*/ | |
function var_dump(obj, indent){ | |
if(typeof indent == "undefined" ) indent="\n"; | |
objType = typeof obj; | |
if(objType == "object" ){ | |
str = "Object("; |
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 | |
/* | |
//Usage: | |
$txt= '<h2> | |
<a | |
href="/w/index.php?title=Lorem_ipsum&action=edit&section=2" | |
title="Edit section: Discovery">edit< / a> <!-- This "a" will be stripped --> | |
<a href="/w/index.php?title=Lorem_ipsum&action=edit&section=2" title="Edit section: Discovery">edit< /a> <!-- This "a" will be stripped --> | |
<a href="/w/index.php?title=Lorem_ipsum&action=edit&section=2" title="Edit section: Discovery">edit</ a> <!-- This "a" will be stripped --> |