PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




hebrevc

Name

hebrevc — Reverses the flow of Hebrew text within a string and converts newlines into HTML <br> tags.

Synopsis

string hebrevc(string, );
string string: String of Hebrew characters
: Maximum length for lines within the converted text

Returns

String

Description

hebrevc() behaves very much like hebrev() - reversing the flow of Hebrew characters and words within a string. Additionally, any newlines within the text are converted to an HTML break (<br>) tag, followed by a single newline character.

Only punctuation characters and ASCII character values between 224 and 251 are affected. All other characters and words within the string are left in their original flow, but may have their positions moved due to changes in the position of Hebrew text in the string.

The optional max_line_length argument can be used to ensure that lines don't exceed a specified length. Lines are split using an HTML break (<br>) tag, followed by a single newline. As with hebrev() , line breaks are made at word boundaries if possible. Use max_line_length to ensure that long lines of Hebrew text are wrapped correctly in environments that don't support languages that flow in a right-to-left fashion.

Tip

hebrev() and hebrevc() can convert Hebrew Logical encoding (the Windows encoding) to Hebrew Visual encoding. 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.



Version

PHP 3+, PHP 4+

See also

To reverse the flow of Hebrew text within a string:

hebrev()



Example

Example 1203. Basic use of hebrevc()

<?php
$hebrew = "’’’’’ ’’’’’’ ’’’’’’’’’­:
’’’ ’’’’’’’­ ’’’’’’ ’’’’’’’ (Thanks Zeev!) ’’’’’’ ’’’’­ ’’’’’’’,
’’  ’’’’’ ’’’’’’ ’’’’’’’ ’’’ ’’ ’’’’’’’’’­ ’’ ’’’’’’.";

echo '---------------------- Before hebrevc() ----------------------<br />',
     nl2br($hebrew);

echo '<div align="right">',
     '---------------------- After hebrevc() -----------------------<br />',
     hebrevc($hebrew),
     '</div>';
?>

Output:
---------------------- Before hebrevc() ----------------------<br />
’’’’’ ’’’’’’ ’’’’’’’’’­:<br />
’’’ ’’’’’’’­ ’’’’’’ ’’’’’’’ (Thanks Zeev!) ’’’’’’ ’’’’­ ’’’’’’’,<br />
’’  ’’’’’ ’’’’’’ ’’’’’’’ ’’’ ’’ ’’’’’’’’’­ ’’ ’’’’’’.

<div align="right">
---------------------- After hebrevc() -----------------------<br />
:’­’’’’’’’’ ’’’’’’ ’’’’’<br>
,’’’’’’’ ’­’’’ ’’’’’’ (Thanks Zeev!) ’’’’’’’ ’’’’’’ ’­’’’’’’ ’’’<br>
.’’’’’’’ ’ ’­’’’’’’’’ ’’’ ’’ ’’’’’’’ ’’’’’’ ’’’’’ ’ ’
</div>



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.