...

View Full Version : making variable that is numeric negative



mhunt
08-28-2007, 09:21 PM
i have a function that gets passed an id
what i want to do is to take the length of that id and then make that length into a negative number. Is there anyway i can do this?


$idlen = strlen($id);
$new = substr($prefix_new, -$idlen);

Mwnciau
08-28-2007, 09:26 PM
-$idlen will turn a positive number into a negative number, eg. 10 becomes -10



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum