문제

I need to implement a GeoPointField with Doctrine2.

It seems that Zend and Doctrine don't support it natively...

Is there a best practice for validating such an input? In the database I'd use a simple string field, right?

도움이 되었습니까?

해결책

/^(\-?\d+(?:\.\d+)?),?\s*(\-?\d+(?:\.\d+)?)$/

This regexp validates and captures GEO input:

  • Latitude, Longitude
  • Latitude Longitude
  • Coords copied directly from GoogleMaps
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top