note 109229 added to function.ord
| From: | xB1N4RYx | Date: | Thu, 28 Jun 2012 00:49:51 +0000 |
| Subject: | note 109229 added to function.ord | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188949@lists.php.net to get a copy of this message | ||
return the chars as a sql char() string
<?php
function AsciiToInt($char){
$success = "";
if(strlen($char) == 1)
return "char(".ord($char).")";
else{
for($i = 0; $i < strlen($char); $i++){
if($i == strlen($char) - 1)
$success = $success.ord($char[$i]);
else
$success = $success.ord($char[$i]).",";
}
return "char(".$success.")";
}
}
echo AsciiToInt("<br>");//outputs char(60,98,114,62)
?>
----
Server IP: 212.63.222.76
Probable Submitter: 83.172.84.34
----
Manual Page -- http://www.php.net/manual/en/function.ord.php
Edit -- https://master.php.net/note/edit/109229
Del: integrated -- https://master.php.net/note/delete/109229/integrated
Del: useless -- https://master.php.net/note/delete/109229/useless
Del: bad code -- https://master.php.net/note/delete/109229/bad+code
Del: spam -- https://master.php.net/note/delete/109229/spam
Del: non-english -- https://master.php.net/note/delete/109229/non-english
Del: in docs -- https://master.php.net/note/delete/109229/in+docs
Del: other reasons-- https://master.php.net/note/delete/109229
Reject -- https://master.php.net/note/reject/109229
Search -- https://master.php.net/manage/user-notes.php