Siggles Posted August 9, 2008 Share Posted August 9, 2008 Hi, If $var = 10 for example, is there a quick way or PHP function I can make that $var -10 (minus 10). The only way I can think is to do $var - $var - $var. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/118956-solved-chainging-an-integer-to-a-minus-number/ Share on other sites More sharing options...
wildteen88 Posted August 9, 2008 Share Posted August 9, 2008 Use -$var Quote Link to comment https://forums.phpfreaks.com/topic/118956-solved-chainging-an-integer-to-a-minus-number/#findComment-612533 Share on other sites More sharing options...
Siggles Posted August 9, 2008 Author Share Posted August 9, 2008 If I want to use that variable somewhere else do I do.. $var = -$var ? Quote Link to comment https://forums.phpfreaks.com/topic/118956-solved-chainging-an-integer-to-a-minus-number/#findComment-612535 Share on other sites More sharing options...
genericnumber1 Posted August 9, 2008 Share Posted August 9, 2008 yes. Quote Link to comment https://forums.phpfreaks.com/topic/118956-solved-chainging-an-integer-to-a-minus-number/#findComment-612542 Share on other sites More sharing options...
Siggles Posted August 9, 2008 Author Share Posted August 9, 2008 Brilliant. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/118956-solved-chainging-an-integer-to-a-minus-number/#findComment-612545 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.