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? 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.