GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Nov-2006, 08:50
abakws abakws is offline
New Member
 
Join Date: Oct 2006
Posts: 18
abakws is on a distinguished road

display ascii


here is the code:
PHP Code:

<?

for($i=0;$i<255;$i++)
{
    $char=chr($i);
    echo $char . "\t";
}
?>


this code doesnt display what i want to because chr()'s syntax is "string chr ( int ascii )" so the 'ascii' variable must be 'int' and in my code $i is string... how do i convert the string i into integer i?



solved:

this one works
PHP Code:

<?

for($i=0;$i<255;$i++)
{
    $char=chr($i);
    echo $i . "=" . $char . "<br>";
}


?>


however i cant figure it out why the first one doesnt work... oh yeah and sorry for that stupid question about converting from string to integer "Variables in PHP are represented by a dollar sign followed by the name of the variable"
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASCII art display prob. suvirj CPP / C++ Forum 2 01-Oct-2006 17:17
How can I read a *.txt file from disk and display the values as bars in TChart Unit1 CPP / C++ Forum 9 07-Sep-2006 15:12
Hw to choose certain field in mysql input by user in visual C++/MFC and display in CR bryan523 CPP / C++ Forum 6 25-Sep-2005 19:19
fedora display problem machinated Computer Software Forum - Linux 1 22-Aug-2005 21:03
Problem with int mixed with char,... leitz CPP / C++ Forum 17 07-Dec-2004 20:56

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 08:36.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.