Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-28-2007, 08:21 PM   PM User | #1
mhunt
Regular Coder

 
Join Date: Mar 2005
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
mhunt is an unknown quantity at this point
making variable that is numeric negative

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?
PHP Code:
  $idlen strlen($id);
  
$new substr($prefix_new, -$idlen); 
__________________
http://www.mh-interactive.com
mhunt is offline   Reply With Quote
Old 08-28-2007, 08:26 PM   PM User | #2
Mwnciau
Regular Coder

 
Join Date: May 2006
Location: Wales
Posts: 820
Thanks: 1
Thanked 82 Times in 79 Posts
Mwnciau is on a distinguished road
-$idlen will turn a positive number into a negative number, eg. 10 becomes -10
Mwnciau is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:45 PM.


Advertisement
Log in to turn off these ads.