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
https://forums.phpfreaks.com/topic/10043-help-with-strlen-script/
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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.