I am working on accessing a db table that will read through a text entry to find a string...then based on that string, create a new variable.
Here's the source:
<?php
$haystack = "Additional Licenses: +2 Licenses /br/ Back-up CD-ROM: No";
$needle = "+0";
switch ($needle) {
case '+1':
if (strstr($haystack, $needle)) {
$actpurch = "3";
} else {
break;
}
case '+2':
if (strstr($haystack, $needle)) {
$actpurch = "4";
} else {
break;
}
case '+3':
if (strstr($haystack, $needle)) {
$actpurch = "5";
} else {
break;
}
default:
$actpurch = "2";
break;
}
echo "Activations Purchased: " . $actpurch;
?>