Received: from mail.imago3d.com (www.imago3d.com [207.89.166.45]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3QFTH303636 for ; Thu, 26 Apr 2001 11:29:17 -0400 (EDT) (envelope-from imago@imago3d.com) Received: from imago [24.247.117.232] by mail.imago3d.com (SMTPD32-6.06) id AE1037400BE; Thu, 26 Apr 2001 11:34:24 -0500 Message-ID: <09fd01c0ce65$ccd14760$e875f718@imago> From: "imago" To: Cc: "Wesley Leonard" References: <00cf01c0b307$02ac4080$543987cf@corp.peoplesoft.com> Subject: data type casting to numbers with intval() or doubleval() Date: Thu, 26 Apr 2001 11:30:04 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Archive-Number: 200104/35 X-Sequence-Number: 288 I am having a problem with the intval() function I am using it to take string data and extract the number it would represent if only numeric. $my_integer = intval($my_string) when the sting is numbers followed by letters - $my_string = 4444mmm $my_integer = 4444 it works as expected but when letters are followed by numbers $my_string = mmm4444 $my_integer = 0 Same problem with doubleval() What am I missing???? how do I drop the non-numeric parts of a string? imago