View Full Version : making variable that is numeric negative

08-28-2007, 08: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);

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