w3schoon Posted February 4, 2013 Share Posted February 4, 2013 Nice to be with you everyone! I have a problem: How to convert numbers to strings using PHP. Try this, $number=11; to convert in string? Thank you. Link to comment Share on other sites More sharing options...
Don E Posted February 4, 2013 Share Posted February 4, 2013 One option would be to use the settype() function: $number = 11;settype($number, "string"); // $number will become "11" (string) 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted February 4, 2013 Share Posted February 4, 2013 If you want to change variable type completely, use settype, else if for temp reasons (string)$number or strval($number), in case you wish reference as an integer again latter on. 1 Link to comment Share on other sites More sharing options...
w3schoon Posted February 4, 2013 Author Share Posted February 4, 2013 Thank you, for letting me know settype function for converting variables into different data type Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now