Remove non-breaking space from Excel (Filter Cell Value)

function format_excel_value($str){
	$str = trim($str);

	if(substr($str, 0, 1) == '='){//"=" will cause formular error
		$str = substr($str, 1);
	}

	$str = preg_replace('/\\\"/', '"', $str);
	$str = preg_replace("/\\\'/", ''', $str);
	$str = preg_replace("/[\n\r]/", '', $str);
	//$str = preg_replace("/[\s\n\r\t\v\x]/", '', $str);//Thsi will remove all space
	$str = preg_replace("~\x{00a0}~siu", '', $str);
	//$str = preg_replace('n\/a', '', $str);
	return $str;
}

Reference: