Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Divide = 0;
- RegEx check for AgentType1 in Charge Code:
- Divide++;
- Set This-AgentType-Gets-Return;
- RegEx check for AgentType2 in Charge Code:
- Devide++;
- Set This-AgentType-Gets-Return;
- ... etc ...
- $valid_codes = array('A', 'J', 'L');
- // deal with the special A2 case first, to get it out of the string
- // this code could be generalized if more special cases need to be handled
- if (stripos($charge_code, 'A2') !== FALSE)
- {
- $found['J'] = true;
- str_ireplace('A2', '', $charge_code);
- }
- foreach ($valid_codes as $code)
- {
- if (stripos($charge_code, $code) !== FALSE) // if the code was in the string
- {
- $found[$code] = true;
- }
- }
- <input type="hidden" name="agent[]" value="A" />
- $divide = count($_POST["agent"]);
- foreach($_POST["agent"] as $agent) {
- $sum = $_POST["amount"] / $divide;
- //do other stuff
- }
- ^([A-Z]d*)*$
Add Comment
Please, Sign In to add comment