Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2004, 04:09 AM
Registered User
 
Join Date: Sep 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP Pattern Matching

Hi all,

I was wondering if anyone could help me with the following problem. I have strings on my page, in which I need to output just the price.

For example:

A string such as: 8 Weeks: 4 Months - £1200

I only want to extract just the £1200 part of it. The trouble is, that I have tried stripping everything but the numbers, but I get something like: 841200 - which is completely wrong.

Any ideas would be greatly appreciated.

Thank you.

 
Old May 17th, 2004, 04:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why don't you search for all the digits after the last whitespace character, or all digits after after the £, or all the last digits in the string?



Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Matching pattern in Given String sanjivbshinde ASP.NET 2.0 Professional 3 October 10th, 2008 06:32 PM
Pattern Matching for Sequentinal numbers like 1234 sriram_r15 Beginning PHP 3 January 20th, 2005 05:46 PM
javascript pattern matching... rbd Javascript 1 October 7th, 2004 12:20 PM
Question on Pattern matching using VBscript Dereksam VBScript 1 September 9th, 2004 04:45 AM
Pattern Matching using PHP spraveens PHP Databases 2 March 23rd, 2004 10:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.