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 | |
/** | |
* Recursive function to turn a DOMDocument element to an array | |
* @param DOMDocument $root the document (might also be a DOMElement/DOMNode?) | |
*/ | |
function Dom2Array($root) { | |
$array = array(); | |
//list attributes |
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
<!doctype html> | |
<!-- | |
PHP Batch Download Script | |
@author Yosko <contact@yosko.net> | |
@copyright none: free and opensource | |
@link http://www.yosko.net/article32/snippet-05-php-telechargement-de-fichiers-par-lots | |
--> | |
<html lang="en-US"> | |
<head> |
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
[ | |
"<em>« C'est bon, oubliez les assiettes. Vous savez jongler ? »<\/em> (le conseiller)<\/p>", | |
"<em>« Celui qui ajoute de nouvelles connaissances aux anciennes est le v\u00e9ritable enseignant. »<\/em> (le conseiller)<\/p>", | |
"<em>« Oh, la jeune fille du magasin de th\u00e9 regarde vers moi. Vite, prenez ce panier que j'aille lui parler! »<\/em> (domestique du march\u00e9)<\/p>", | |
"<em>« Cette ville est plus belle que la plus belle des concubines de Chine! »<\/em> (garde)<\/p>", | |
"<em>« Par la dent \u00e9cras\u00e9e du dragon! C'est une ville splendide! »<\/em> (herboriste)<\/p>", | |
"<em>« Les gens ne sont plus respectueux de leurs anc\u00eatres. Le malheur va frapper notre ville. »<\/em> (devin)<\/p>", | |
"<em>« L'heure du d\u00e9part est toujours un moment intense. J'esp\u00e8re simplement revenir la t\u00eate sur les \u00e9paules. »<\/ |
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 | |
/** | |
* Convertisseur de contenu d'une base sqlite d'article Blogotext 2 | |
* vers des fichiers XML compatible Pluxml 5 | |
* | |
* Nécessite : | |
* - fichier "database.sqlite" dans le même dossier que ce script | |
* - sous-dossier "articles" VIDE | |
* - sous-dossier "commentaires" VIDE |
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
<div class="pagination"> | |
<?php | |
foreach($pagination as $key => $value) { | |
if($value == 'current') { | |
echo '<span>'.$key.'</span>'; | |
} else { | |
if($value == 'last') | |
echo '…'; | |
echo '<a href="path/to/my/list/'.$key.'">'; |
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 | |
/* | |
Color lib by Yosko (http://www.yosko.net/) | |
Licence: WTFPL except for the following | |
source for HSL algorithm: http://www.easyrgb.com/index.php?X=MATH | |
*/ | |
//returns a clean 6 digit hex number as a string | |
function cleanHexColor($hex) { | |
$hex = strtolower($hex); |