Skip to content

Instantly share code, notes, and snippets.

@flexseth
Last active August 29, 2015 14:05
Show Gist options
  • Save flexseth/b23f1d1d686d1b6effe0 to your computer and use it in GitHub Desktop.
Save flexseth/b23f1d1d686d1b6effe0 to your computer and use it in GitHub Desktop.
Logic for figuring out what gun we're looking at
// figure out which model this is
$model = $rifle->get_title();
$is_birthday = preg_match("/50/", $model) == 1 || preg_match("/60/", $model) == 1;
$is_occasion_big_boy = preg_match('/occasion/', $model) == 1 && preg_match('/big/', $model) == 1;
$is_occasion_golden_boy = preg_match('/occasion/', $model) == 1 && preg_match('/golden/', $model) == 1;
$is_personal_serial = preg_match('/serial/', $model) == 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment