[Phpwm] unsigning a numeric variable

Phil Beynon phil at infolinkelectronics.co.uk
Fri May 5 20:51:16 BST 2006

Regards Stationery

  I'm a newcomer to the site so please forgive me if I post messages
incorrectly (and please tell me how to do it properly!)

  Am I missing something obvious, or can you simply use the abs() function
to obtain the absolute value of the number? This could be combined with the
function is_numeric() to do the validation on user input that you need.

  I hope this helps

  Black Hill Computer Software
  01981 510 180

  Hi Paul,

  abs() was fine, mostly it was just me having a blank moment and completely
forgetting about the command after a seriously long day programming.
  it came out in part like;

  if(!is_numeric($height)){$height = $oldh;} $height = abs(intval($height));
if(($height < 70) || ($height > 768)){$height = $oldh;}


  Nothing I can see wrong with your posting, more the merrier!

  Phil Beynon
  Sales director

  ** http://www.diygear.com THE Online DIY Toolstore For DIY & Business
  ** Infolink Electronic Systems Ltd. http://www.infolinkelectronics.co.uk
  ** Professional Web Design & Cobalt Hosting Solutions
  ** Contact: Sales at infolinkelectronics.co.uk
  ** Tel / Fax 0121 458 4894 (office) 0121 441 3558 (home) 07801 548464

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/phpwm/attachments/20060505/0111c8e0/attachment.html

More information about the Phpwm mailing list