PlantUML encoding functions

v1.0.7 2019-09-16 19:20 UTC

This package is auto-updated.

Last update: 2020-08-07 15:21:44 UTC


This library exposes the PHP implementation of four PlantUML encoding functions:

  • encodep()
  • encode6bit()
  • append3bytes()
  • encode64()

Usually only encodep() is used.

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads PHPPackages Rank PHPPackages Referenced By composer.lock Average time to resolve an issue Percentage of issues still open PDS Skeleton Issues


PlantUML uses a special encoding to transform an uml text description like this:

Bob -> Alice : hello

into this:


The advantage of the last encoding is that it is easier to use in URL:



Install using Composer:

$ composer require jawira/plantuml-encoding


You must import encodep() function before using it:

require 'vendor/autoload.php';

use function Jawira\PlantUml\encodep;

$encode = encodep('Alice -> Bob: hello');
echo "http://www.plantuml.com/plantuml/uml/{$encode}";

💡 Only PHP 5.6+ allows importing functions, for versions < PHP 5.6 you have to use full function's namespace.

⚠️ Since v1.0.0, encodep() function expects to receive an UTF-8 string.

More examples:


These functions are a copy/paste from http://plantuml.com/code-php.

Packages from jawira

jawira/plantuml (library)
Provides PlantUML integration: plantuml executable and plantuml.jar
jawira/emoji-catalog (library)
Get access to +3000 emojis as class constants.
jawira/case-converter (library)
Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.