Codeschnipsel Nützliche kleine Codeschnipsel ;)
Wegen diesem Thread habe ich eine kleine Funktion geschrieben, die mittels GD2 in PHP Text innerhalb und entlang eines Kreises ("draw circular text") ausgibt. Beispiel-Ausgaben Code PHP-Code: <?php /** * Draws a circular text on a (virtual) circle in a GD2 image * @param resource $imgObj The GD2 object * @param array $textProps Associative ...
<?php /** * Draws a circular text on a (virtual) circle in a GD2 image * @param resource $imgObj The GD2 object * @param array $textProps Associative
Für alle, die gerne JSON-Daten mit PHP komprimieren möchten. Diese Funktion entfernt alle Steuerzeichen sowie alle Leerzeichen: PHP-Code: /** * Compresses a JSON string by removing all control characters and white spaces * @param string $json The JSON to compress * @author ComFreek * <code> * $old_json = file_get_contents('old.json'); * $new_json = json_compress( $old_json ); * file_put_contents('new.json', ...
/** * Compresses a JSON string by removing all control characters and white spaces * @param string $json The JSON to compress * @author ComFreek * <code> * $old_json = file_get_contents('old.json'); * $new_json = json_compress( $old_json ); * file_put_contents('new.json',