ech" /> ech" /> ech"/>

CP437 writing dash sign ─

72 Views Asked by At

Using sprintf need a fill up a character https://www.compart.com/en/unicode/U+2500

On console unix:

php > echo sprintf("%'-7s", '');
-------

php > echo sprintf("%'─7s", '');
�7s

A sign "─" is cp437 dash.

I need result:

───────

TEST: https://3v4l.org/JsAv6

This works:

php > echo sprintf("─", '');
─

Example:

echo sprintf("%'-7s", 'a');
------a

using dash will not work:

php > echo sprintf("%'─7s", 'a');
�7s
0

There are 0 best solutions below