On 5/3/05, Gordon Stewart <[EMAIL PROTECTED]> wrote:
> Hmm However thats ONLY good if ive hard-coded LA%678 into the search....
> Hmmm - Might do a few preg-match / Preg-replace- It could be done - Thanks....
> hmm Did a quick test - & its going :)
> 
> if (preg_match("/^\s*(\w+.*?\D)\s*(\d+\d*?)\s*$/i", $SEARCHTEXT,$matches)){
> $SEARCHTEXT="$matches[1]%$matches[2]";
> }
> echo "DOING SEARCH - '$SEARCHTEXT'<BR>\n";
> 
> Basically - If the search is leters/numbers - With or without  a space
> - Then it inserts the %

I have thought something using str_replace(), but so far so good.
Yours is more complete. Just take care with LIKE and ILIKE.

-- 
Bruno Lustosa, aka Lofofora          | Email: [EMAIL PROTECTED]
Network Administrator/Web Programmer | ICQ: 1406477
Rio de Janeiro - Brazil              |


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to