Jump to content

Help with 'strlen' script


DBookatay

Recommended Posts

I am working on a site for an auto dealership where users can search based on certain criteria, one of which is the VIN number.

I have this one input: [code]if($_POST['vin']) {$where[] = "vin = '{$_POST['vin']}'";}[/code] which works with the search script I was able to hack together, but what I want to do is also have the ability to search by the last 6 of the VIN. Meaning if a user enters all 17 alpha-numeric characters it returns a result, and as well if they only enter the last 6 characters of the vin...

Does anyone have any idea how I can go about this?
Link to comment
Share on other sites

[!--quoteo(post=375398:date=May 19 2006, 08:12 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 19 2006, 08:12 PM) [snapback]375398[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]
$last_six = substr($_POST['vin'], -6);
[/code]
[/quote]

I don't get it! How do I make it work based on the example I posted?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.