View Single Post
Old 10-21-2013, 08:40 PM  
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
super quick php question

Code:
	preg_match('/(USPS|UPS)\s+?(Postal|Ground|Priority)\s/i',$page,$matched);
					if (isset($matched[1])) {
						$shipper = $matched[1];
					}
					if (isset($matched[2])) {
						$shipping_method = $matched[2];
					}
I want $shipping_method to be redeclared as 'USPS Priority' if it is previously declared as 'Postal' I made the below if statement to redeclare it but it is basically declaring it no matter what, even if it was original declared 'Ground'. I know I am missing something really simple. Any help? Programmer is offline and wanted to get this done tonight.



I added

Code:
		if ($shipping_method='Postal')
					{
						$shipping_method='Priority Mail';
					}
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote