Search found 5 matches

by 87ASC
Sun Aug 26, 2007 8:33 am
Forum: PHP - Code
Topic: VIN Decoder Help
Replies: 9
Views: 533

feyd wrote:Switch in_array() for array_key_exists().
Great! It work's! How is it that array_key_exists() work's instead of in_array()? How do make a newline? I read that you would have to make a new:

Code: Select all

<?php
?>
Their has to be a easier way.
Thank's.
by 87ASC
Sun Aug 26, 2007 4:06 am
Forum: PHP - Code
Topic: VIN Decoder Help
Replies: 9
Views: 533

An array would be useful here (so would a database if there's a lot of them) $cuns = array('000001' => '19xx model', '000002' => '199x model'); if(!empty($_POST['cun']) && in_array($_POST['cun'], $cuns)) { echo $cuns[$_POST['cun']]; } else { echo 'error'; } I read up on the function's you h...
by 87ASC
Sat Aug 25, 2007 8:14 pm
Forum: PHP - Code
Topic: VIN Decoder Help
Replies: 9
Views: 533

feyd wrote:Read the manual's page on strings: http://php.net/language.types.string
I tried that, I read up on it, what I think is the problem is that their are too many if and esle statement's. I would think their is some kind of other way to do this, I was thinking some kind of an array.
Thank's.
by 87ASC
Sat Aug 25, 2007 6:30 am
Forum: PHP - Code
Topic: VIN Decoder Help
Replies: 9
Views: 533

Ok, so that would be all that would have to be done for it to work? Also should it look like this? <?php $cun = $_POST["vintextbox"]; if ($cun["vintextbox"] == '000001') { echo "Car number $cun00["vintextbox"] is a 1987."</br> } if ($cun["vintextbox"...
by 87ASC
Sat Aug 25, 2007 3:52 am
Forum: PHP - Code
Topic: VIN Decoder Help
Replies: 9
Views: 533

VIN Decoder Help

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] I need so...