I am getting a parse error: syntax error, unexpected '{' in line 2 "" and I do not see the problem Has been there.
& lt ;? Php square point location {var $ pointOnVertex = true; // Check that if the point sits properly at the point of point () {} function point InPolygon ($ point, $ polygon, $ pointOnVertex = true) in any one corner {$ this- & gt; PointOnVertex = $ pointOnVertex; // Direct the string in the arrays with X and Y $ point = $ this- & gt; Point StringToc Corded ($ point); $ Angle = array (); Forex Currency (as the polygon top $) {$ sugars [] = $ this- & gt; Point StringToc Corded ($ top); } // Check if the point sits right on top (if $ -> this-> pointOnViretex == correct and $ -> pointOnViretex ($ point, $ upper) == true) {return "top"; } // Check that the point is within the polygon or at the cross-border $ intersection = 0; $ Vertices_count = Counting ($ corner); For ($ i = 1; $ i <$ Vertis_mount; $ i ++) {$ Vertex 1 = $ Vertis [$ I-1]; $ Vertex2 = $ corner [$ i]; If ($ vertex1 ['y'] == $ vertex2 ['y'] and $ vertex1 ['y'] == $ point ['y'] and $ point ['x']> min ($ vertex1 ['X'], $ vertex2 ['x']) and $ point ['x'] & lt; max ($ vertex1 ['x'], $ vertex2 ['x']) {// At the point is a horizontal polygon border "border" return; } If the ($ point ['y'] & gt; min ($ verttex 1 ['y'], $ vertex 2 ['y']) and $ point ['y'] & lt; = max ($ vertex1 [ 'Y'], $ vertex2 ['y']) and $ point ['x'] & lt ;! = maximum ($ vertex1 ['x'], $ vertex2 ['x']) and $ vertex1 [' Y '] = $ vertex2 [' y '] - $ $ [x] = ($ point [' y '] - $ vertex 1 [' y ']) * ($ vertex 2 [' x '] - $ vertex 1 ['X']) / ($ vertex 2 ['y'] - $ vertex1 ['y']) + $ vertex1 ['x']; if ($ xinters == $ point ['x']) {/ / Check that the point is at the border of the polygon (in addition to the horizontal) return "border";} if ($ Vertix 1 ['x'] == $ vertex 2 [' X '] || $ point [' x '] & lt; = $ xinters] {$ intersection ++;}}} // If through which edges we have passed, even then, it is in polygon. ($ Intersection% 2! = 0) {back "inside";} other {return "out";}} function pointOnViretex ($ point, $ uppercase) {foreach ($ Vertex $ Vertex) {if ($ point == $ Vertex) {return true;}}} Function Point Strings Cardcard ($ pointstring) {$ coordinate = explosion ("", $ point string); Return array ("x" => gt; coordinates [0], "y" = & gt; $ coordinate [1]); }} $ PointLocation = new point location (); $ Points = array ("30 19", "0 0", "10 0", "30 20", "11 0", "0 11", "0 10", "30 22", "20 20") ; $ Polygon = array ("10 0", "20 0", "30 10", "30 20", "20 30", "10 30", "0 20", "0 10", "10 0") ; Forex currency ($ points as the $ key = & gt; $ point) {resonant is "$ key ($ point)" $ point-position-> Pointin polygon ($ point, $ polygon) "
"; }? & Gt;
Is anyone seeing a problem?
Thank you,
- Lakkidi
works fine That's my end, so it looks like an encoding or EOL problem: Try these things:
- Make sure your file is in Unix EOL format. Each line must end with a line feed (LF)
- Make sure that you do not have a BOM (byte order mark) in your files.
- You can try to get rid of
? & Gt;
This is no purpose at the end of your file. It is true that this will not really help in solving your problem, but it will make your code a bit cleaner. - Try adding a line break after your opening
and after your
class dot location {
. Some versions of PHP travel on weird whitspace. - Make sure that your file is in some standard, such as UTF-8
is a good editor to make sure that your file meets these criteria There are so many options and they make it easy to dead. Do not use plain old notepad, because Microsoft does not put you in CRFF format (pff-friendly) and you do not control encoding.
Good luck!
Comments
Post a Comment