Number To String Conversion

Reply

Join Date: Apr 2005
Posts: 71
Reputation: AhmedHan is an unknown quantity at this point 
Solved Threads: 1
AhmedHan's Avatar
AhmedHan AhmedHan is offline Offline
Junior Poster in Training

Number To String Conversion

 
0
  #1
Apr 23rd, 2006
I have an HTML which posts a form to a PHP page. The PHP page encodes the password from the form using md5() function. And then I tried to save this MD5 code into a file using fwrite() function.

Here the error occures. fwrite() only accepts string parameter, but the return value of md5() is a number data type.

Can you tell me how can I convert a number to string, or string to number in PHP? (For general purpose. Not for only this problem.)
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 32
Reputation: BlazingWolf is an unknown quantity at this point 
Solved Threads: 1
BlazingWolf BlazingWolf is offline Offline
Light Poster

Re: Number To String Conversion

 
0
  #2
Apr 23rd, 2006
Originally Posted by AhmedHan
Can you tell me how can I convert a number to string, or string to number in PHP? (For general purpose. Not for only this problem.)
PHP is not a typed langauge so there is no string or number. A varible is a varible is a varible.

It probaby has something to do with missing qoutes but post the code and this will be a much eaiser question to answer.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 71
Reputation: AhmedHan is an unknown quantity at this point 
Solved Threads: 1
AhmedHan's Avatar
AhmedHan AhmedHan is offline Offline
Junior Poster in Training

Re: Number To String Conversion

 
0
  #3
Apr 24th, 2006
I found the answer in documentation.

strval() --> num 2 str
intval() --> str 2 num
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC