.. _php-strtrarguments: .. _strtr-arguments: Strtr Arguments +++++++++++++++ `Strtr() `_ replaces characters by others in a string. When using strings, `strtr() `_ replaces characters as long as they have a replacement. All others are ignored. In particular, `strtr() `_ works on strings of the same size, and cannot be used to remove chars. .. code-block:: php See also `strtr `_. Suggestions ___________ * Check the call to strtr() and make sure the arguments are of the same size * Replace strtr() with str_replace(), which works with strings and array, not chars * Replace strtr() with preg_match(), which works with patterns and not chars Specs _____ +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/StrtrArguments | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`CE `, :ref:`CI-checks `, :ref:`Changed Behavior ` | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.2.3 | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Instant (5 mins) | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Examples | :ref:`case-suitecrm-php-strtrarguments` | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Community Edition `_, `Exakat Cloud `_ | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+