chasethemetal Posted October 25, 2011 Share Posted October 25, 2011 Hey all. I was wondering how one would escape brackets of this nature [ ]. I'm not sure if escaping is what I need to do either. Basically I have PHP echoing javascript. But whenever [ ] are involved it messes up all of the code coloring of BBedit / Dreamweaver etc.... This is isn't too serious, and the code still works. It just makes all of the color coding messed up. Right now I'm looping something that looks like this.... $a .= ['day', 5], this is something thats been bothering me for awhile. it's like a needle in my side. Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted October 25, 2011 Share Posted October 25, 2011 That's not valid in PHP, if that's Javascript that you are outputting should it be inside a string: $a .= "['day', 5],"; Link to comment Share on other sites More sharing options...
chasethemetal Posted October 25, 2011 Author Share Posted October 25, 2011 Yeah my bad!!! No it is like. $a = "['day', 5],"; sorryyy. But still when doing that it makes all of the color coding of the code all messy. Any thoughts on clearing that up? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 25, 2011 Share Posted October 25, 2011 There's nothing there that should screw up the syntax highlighter, it sounds like the program you're using has a bug there. That highlights fine in Sublime Text and ConTEXT. The major issue with highlighting in ConTEXT is if you have a PHP file with an HTML block, and the HTML contains a single quote like an apostrophe. Sublime has a much more intelligent highlighter which doesn't get screwed up by that. In fact, Sublime will even correctly highlight a string of SQL code inside PHP as SQL. Link to comment Share on other sites More sharing options...
chasethemetal Posted October 25, 2011 Author Share Posted October 25, 2011 Oh ok. So Sublime Text is your editor of choice? I'm using BBEdit right now. And I don't alike because of this one factor. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 25, 2011 Share Posted October 25, 2011 I use ConTEXT for some things, but ConTEXT isn't able to save as UTF8. Sublime has several features that ConTEXT lacks, but ConTEXT is very lightweight. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.