parse error: unexpected T_STRING

Issue:

when using test site of my oscommerce online shop, there’s “parse error: unexpected T_STRING ….checkout_success.php in line 20”

Solution:
Add immediately before each apostrophe: ‘ containing text string AND included in an outer pair of apostrophes, i.e. change

‘Text’
to: [backslash]’Text[backslash]’

boy’s
to: boy[backslash]’s

Tricks:

  1.     sometimes this error happen suddenly because opening the file in some text editor from filemanager will unexpectedly remove the [backslash] sign.
  2.     for those apostrophe containing defined variables or contained in NO outer pair of apostrophes, no need to add any [backslash].
  3.     in this plog, it automatically remove all my backslash sign, so i have to only use backslash instead of the sign. Interesting!!
Close Menu