943,786 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 114455
  • PHP RSS
Apr 23rd, 2006
0

Number To String Conversion

Expand Post »
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.)
Similar Threads
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
AhmedHan is offline Offline
71 posts
since Apr 2005
Apr 23rd, 2006
0

Re: Number To String Conversion

Quote 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.
Reputation Points: 10
Solved Threads: 1
Light Poster
BlazingWolf is offline Offline
32 posts
since Feb 2006
Apr 24th, 2006
1

Re: Number To String Conversion

I found the answer in documentation.

strval() --> num 2 str
intval() --> str 2 num
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
AhmedHan is offline Offline
71 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help SOS
Next Thread in PHP Forum Timeline: need help exporting oracle data using php ASAP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC