seany123 Posted September 3, 2011 Share Posted September 3, 2011 Is there any function i can use to make this T STRING error stop? $desc = "this is a "test" this is a test"; i just want it so everything inside the initial 2 "s are classed as just normal text or whatever? Thanks Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 3, 2011 Share Posted September 3, 2011 You can either escape the inner quotes with backslashes, or enclose the string in the opposite (single) quotes. Quote Link to comment Share on other sites More sharing options...
Clarkeez Posted September 3, 2011 Share Posted September 3, 2011 $desc = "this is a \"test\" this is a test"; or $desc = 'this is a "test" this is a test'; Quote Link to comment Share on other sites More sharing options...
seany123 Posted September 3, 2011 Author Share Posted September 3, 2011 using a Single ' wont work becuase some of the strings use the single quotes.. which would give the same result. manually adding backslashes again wont be economical because the strings that im having this problem with are in my database and there are atleast 50,000 strings. is there no way of just stating that everything inside the initial ""s should be classed as normal text then? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 3, 2011 Share Posted September 3, 2011 You should have stated that up front. What about using HEREDOC syntax? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.