Tom, put a space in, because there's a space between your brand and model:
preg_match('/ [a-z0-9]+/i', $product_name);
Added the i to make it case-insensitive.
Tony
Hi
I'm struggling to do something very simple with regular expressions and preg_match.
I have: BRAND MODEL
Something like: Sony A1B2
I want to extract just the model, so the reg ex I need is 'a complete word containing both letters and numbers'.
Here's what I thought should work:
preg_match("/[a-zA-Z0-9]+/", $product_name);
But that brings back Sony. Any help very much appreciated.
Thanks
Tom
Tom, put a space in, because there's a space between your brand and model:
preg_match('/ [a-z0-9]+/i', $product_name);
Added the i to make it case-insensitive.
Tony
The trouble with the rat race is that even if you win you're still a rat.
Time passes. Listen. Time passes. Dylan Thomas
Ebay Alerts to your inbox
These questions have raised the concept of web statistics. Often times, webmasters use certain programs, such as Google Analytics or Awstats, to complete this job for them. These programs obtain a wide variety of information about visitors to a site. They find page views, visits, unique visitors, browsers, IP addresses, and much more. But how exactly is this accomplished? Follow along as we present a tutorial on how to create your own web statistics program using PHP, JavaScript, AJAX, and SQLite.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks