PlantUML text encoding functions for PHP
This library
exposes PlantUML text encoding functions:
encodep()
encode6bit()
append3bytes()
encode64()
ℹ️ Usually only encodep()
is used.
<?php
use function Jawira\PlantUml\encodep;
$diagram = <<<TXT
@startuml
Bob -> Alice : hello
@enduml
TXT;
$encode = encodep($diagram); // SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
echo "https://www.plantuml.com/plantuml/uml/$encode";
Output: https://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
⚠️ Since v1.0.0, encodep()
function expects to receive an UTF-8 string.
$ composer require jawira/plantuml-encoding
These functions are a copy/paste from http://plantuml.com/code-php.