.. _php: PHP *** Many :wp:`PHP` programs make use of a localisable string array. The toolkit supports the full localisation of such files with :doc:`/commands/php2po` and po2php. .. _php#conformance: Conformance =========== Our format support allows: * `Single `_ and `double `_ quoted strings (both for keys and values) .. code-block:: html+php 'value', 'name2' => "value2", "key1" => 'value3', "key2" => "value4", ); * PHP define syntax .. versionadded:: 1.10.0 .. code-block:: html+php `_ .. versionadded:: 2.3.0 .. code-block:: html+php "bar", "bar" => "foo", ]; * `Heredoc `_ .. versionadded:: 2.3.0 .. code-block:: html+php `_ .. versionadded:: 2.3.0 .. code-block:: html+php `_ and `double `_ quoted strings) .. code-block:: html+php 'value', 'info' => 'Some hosts disable automated mail sending on their servers. In this case the following features cannot be implemented.', 'name2' => 'value2', ); * Various layouts of the id .. code-block:: html+php 'value' , ); define('item', 'string' ); * Nested arrays with any number of nesting levels .. versionadded:: 1.11.0 .. code-block:: html+php 'value', 'datetime' => array( 'TODAY' => 'Today', 'YESTERDAY' => 'Yesterday', 'AGO' => array( 0 => 'less than a minute ago', 2 => '%d minutes ago', 60 => '1 hour ago', ), 'Converted' => 'Converted', 'LAST' => 'last', ), ); * Whitespace in the array declaration .. versionadded:: 1.11.0 .. code-block:: html+php "this", "two" => "that", ); * Blank array declaration, then square bracket syntax to fill that array .. versionadded:: 1.12.0 .. code-block:: html+php "this", ); * Array entries without ending comma: .. versionadded:: 2.3.0 .. code-block:: html+php "this", "two" => "that" ); * Array entries with space before comma: .. versionadded:: 2.3.0 .. code-block:: html+php "this", "two" => "that" , ); * Nested arrays declared on the next line: .. versionadded:: 2.3.0 .. code-block:: html+php array( "two" => "dous", ), ); * Nested arrays with blank entries: .. versionadded:: 2.3.0 .. code-block:: html+php array( "" => "", "two" => "dous", ), ); * Strings with slash asterisk on them: .. versionadded:: 2.3.0 .. code-block:: html+php 'Other value /* continued', ); * Array entries with value on next line: .. versionadded:: 2.3.0 .. code-block:: html+php 'bar', ); * Array defined in a single line: .. versionadded:: 2.3.0 .. code-block:: html+php 'value1', 'item2' => 'value2', 'item3' => 'value3' ); * Keyless arrays: .. versionadded:: 2.3.0 .. code-block:: html+php "value")); * Concatenation of strings and variables: .. versionadded:: 2.3.0 .. code-block:: html+php 'There is one apple|There are many apples', ]; .. _php#non-conformance: Non-Conformance =============== The following are not yet supported: * There are currently no known limitations.