#!/usr/bin/php5 ord('~'))) and (! in_array($intChrValue, array(10, 13)))): $blnHexValue = TRUE; $intIndex = strlen($strText); else: switch($strCharacter): case '\\': $strCharacter = '\\\\'; break; case '\'': $strCharacter = '\'\''; break; // ANSI SQL syntax case "\n": $strCharacter = '\\n'; break; case "\r": $strCharacter = '\\r'; break; endswitch; $strResult .= $strCharacter; endif; endfor; if($blnHexValue): $strResult = '0x'; // One giant hex string for($intIndex=0; $intIndex