Submitted : |print

**SPIP**

# Article submitted

The article "**|print**
(https://www.spip.net/ecrire/?exec=article&id_article=6563)" is submitted
for publication. on Thursday 21 May 2020.

* * *

## |print

Thursday 21 May 2020 , by [jack](.././?page=auteur&id_auteur=593&)

The filter **`|print`** produces a human-readable display of the tag to
which it applies.

- When the tag is *a string*, for example:

    "Il était une fois dans la ville de Foy..."

then the result displayed is this string passed through the filter `|typo`
(unbreakable spaces, conversion of quotes...)

- When the tag is an array which is itself *a simple list*, for example:

    array('jean', 'pierre', 'lucie', 'zoé')

or an array where all the keys are numeric, for example:

    array(0 => 'jean', 1 => 'pierre', 2 => 'lucie', 3 => 'zoé')

then the result displayed is a simple enumeration whose elements are
separated by a comma.

In this example, the display will therefore be: `"jean, pierre, lucie,
zoé"`

- When the tag is *an array* which contains non-numeric keys or elements
which are themselves arrays, the filter displays one line per entry, with
the name of the key of the sub-array followed by the value (itself
displayed according to the same rules: string or enumeration or array in
lines).

For example [1] :

    array('arbre' => array('pin', 'cyprès', 'eucalyptus'), 'fleur' =>
array('rouge' => 'coquelicot', 'bleu' => 'lavande', 'jaune' => 'crocus'))

will display the html source:

    <br>
    arbre: pin, cyprès, eucalyptus
    <br>
    fleur:
    <br>
    &nbsp;rouge: coquelicot
    <br>
    &nbsp;bleu: lavande
    <br>
    &nbsp;jaune: crocus

qui se visualisera ainsi :

arbre: pin, cyprès, eucalyptus
fleur:
rouge: coquelicot
bleu: lavande
jaune: crocus

[1] this array can be a #ARRAY written in spip syntax:

    #SET{tabl, #ARRAY{arbre, #ARRAY{0, pin, 1, cyprès, 2, eucalyptus},
fleur, #ARRAY{rouge, coquelicot, bleu, lavande, jaune, crocus}}}

— Sent by SPIP (https://www.spip.net/)

rubon199.jpg

puce.gif