Windows php error on first line with <? -


i have php script starts following line

<?xml version="1.0" encoding="utf-8"?> 

it works fine in lamp world when port windows think thinks line code when it's not error in visual studio:

syntax error: unexpected token 'version'

is there way can windows php not consider code? thought code blocks had start <?php?

you can use header function of php render tag you. put @ first line of code:

<? header("content-type: text/xml; charset=utf-8") ?>  

then won't have problems opening php tag.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -