xxreenaxx1 Posted March 8, 2011 Share Posted March 8, 2011 can you have something like.. echo $whatever; this putput 1.2 can you split this number so the first integer will be in $val"(1)" or whatever and the second integer after the "." will be in $val2"(2)" Quote Link to comment Share on other sites More sharing options...
silkfire Posted March 8, 2011 Share Posted March 8, 2011 $val = array(floor($whatever), $whatever - floor($whatever)); echo $val[0], '<br>'; echo $val[1]; Quote Link to comment Share on other sites More sharing options...
xxreenaxx1 Posted March 8, 2011 Author Share Posted March 8, 2011 You are awesome......... One more question. When I print my second value. its does 0.3 or 0.1 or whatever Quote Link to comment Share on other sites More sharing options...
silkfire Posted March 8, 2011 Share Posted March 8, 2011 Oh sorry didn't really test the code =P Could this work better? $val = array(floor($whatever), substr(strstr($whatever, '.'), 1)); echo $val[0], '<br>'; echo $val[1]; Quote Link to comment Share on other sites More sharing options...
xxreenaxx1 Posted March 8, 2011 Author Share Posted March 8, 2011 Thank you . It works Quote Link to comment Share on other sites More sharing options...
xxreenaxx1 Posted March 8, 2011 Author Share Posted March 8, 2011 I dont see the solved button. But this has been solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.