Guest User

Untitled

a guest
Jun 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Divide = 0;
  2. RegEx check for AgentType1 in Charge Code:
  3. Divide++;
  4. Set This-AgentType-Gets-Return;
  5. RegEx check for AgentType2 in Charge Code:
  6. Devide++;
  7. Set This-AgentType-Gets-Return;
  8. ... etc ...
  9.  
  10. $valid_codes = array('A', 'J', 'L');
  11.  
  12. // deal with the special A2 case first, to get it out of the string
  13. // this code could be generalized if more special cases need to be handled
  14. if (stripos($charge_code, 'A2') !== FALSE)
  15. {
  16. $found['J'] = true;
  17. str_ireplace('A2', '', $charge_code);
  18. }
  19.  
  20. foreach ($valid_codes as $code)
  21. {
  22. if (stripos($charge_code, $code) !== FALSE) // if the code was in the string
  23. {
  24. $found[$code] = true;
  25. }
  26. }
  27.  
  28. <input type="hidden" name="agent[]" value="A" />
  29.  
  30. $divide = count($_POST["agent"]);
  31. foreach($_POST["agent"] as $agent) {
  32. $sum = $_POST["amount"] / $divide;
  33.  
  34. //do other stuff
  35. }
  36.  
  37. ^([A-Z]d*)*$
Add Comment
Please, Sign In to add comment