viion Posted July 29, 2009 Share Posted July 29, 2009 How would I do powers in php? Like when you do 5 to the power of 5, it'd return 5x5x5x5x5 Is there a function to do this in php? Quote Link to comment https://forums.phpfreaks.com/topic/168006-how-to-do-powers-in-php/ Share on other sites More sharing options...
Maq Posted July 29, 2009 Share Posted July 29, 2009 pow - Please search the manual first. Quote Link to comment https://forums.phpfreaks.com/topic/168006-how-to-do-powers-in-php/#findComment-886109 Share on other sites More sharing options...
Daniel0 Posted July 29, 2009 Share Posted July 29, 2009 pow - Please search the manual first. Though he said he wanted the 5x5x5x5 returned, not 3125. You can do echo join('x', array_fill(0, 5, 5)); By the way, I hate that notation. You can't tell if it's supposed to be 3125 or 3125x4 Quote Link to comment https://forums.phpfreaks.com/topic/168006-how-to-do-powers-in-php/#findComment-886152 Share on other sites More sharing options...
Maq Posted July 29, 2009 Share Posted July 29, 2009 Though he said he wanted the 5x5x5x5 returned, not 3125. Oops, sorry about that viion. Quote Link to comment https://forums.phpfreaks.com/topic/168006-how-to-do-powers-in-php/#findComment-886160 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.