PHP Function Reference

PHP hebrevc() Function



The PHP hebrevc() function converts logical Hebrew text to visual text with newline conversion. Hebrew visual requires no special right-to-left character support to be displayed properly, making it very useful for displaying Hebrew text on the web. The function tries to avoid breaking words if possible.

Note: This function is similar to hebrev() with the difference that it converts newlines (\n) to "<br>\n".

Note: This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0.

Syntax

hebrevc(string, max_chars_per_line)

Parameters

string Required. Specify the Hebrew input string.
max_chars_per_line Optional. Specify maximum number of characters per line that will be returned.

Return Value

Returns the visual string.

Example:

In the example below, hebrevc() function returns the trimmed version of the given string.

<?php
echo hebrevc("? ?? ??? \n ????");
?>

The output of the above code will be:

??? ?? ?
????

❮ PHP String Reference