$expected = array( 'carModel', 'year', 'bodyStyle' ); foreach( $expected AS $key ) { if ( !empty( $_POST[ $key ] ) ) { ${$key} = $_POST[ $key ]; } else { ${$key} = NULL; } }
$carModel = $_POST['carModel']; $year = $_POST['year']; $bodyStyle = $_POST['bodyStyle'];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)