Kyrislian Posted August 12, 2010 Share Posted August 12, 2010 I will state right here that I've never really delved into PHP before, but I'm prying apart the code on my site (a programmer made it for me). I've figured out how to add more checkboxes onto the page, but I've run into a problem. 'Artist' => array ( 'Cassiadawn', 'Cryptic', 'Diction', 'Glorfindel', 'Kyrislian', 'Russa', 'Ntkufreak', 'Taliba', 'Thunderbun', 'Velg', 'Lostdollie', 'Pookawitch') What I'm trying to do is replace 'Lostdollie', 'Pookawitch' with 'Lostdollie [R]', 'Pookawitch[R]'. How can I do this? I'd really appreciate any help anyone can give me! Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/ Share on other sites More sharing options...
trq Posted August 12, 2010 Share Posted August 12, 2010 Just do what you have done in your example. As long as you stay between the quotes it'll be fine. Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/#findComment-1098398 Share on other sites More sharing options...
Kyrislian Posted August 12, 2010 Author Share Posted August 12, 2010 The funny thing is that when I do use those, the data isn't saved so their respective checkboxes don't remain checked. All options from then on down continue to behave as if nothing had been checked. Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/#findComment-1098403 Share on other sites More sharing options...
Daniel0 Posted August 12, 2010 Share Posted August 12, 2010 On GET/POST data, PHP considers things in [] to be array indices. Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/#findComment-1098406 Share on other sites More sharing options...
Kyrislian Posted August 12, 2010 Author Share Posted August 12, 2010 Is there any way then for me to use it? I know that some code you can circumvent them by using special combinations of text/character but I'm unsure if there's anything like this for php. Also, if there's no way of using it, how about ( )? Thanks much for all the helpful advice! Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/#findComment-1098411 Share on other sites More sharing options...
trq Posted August 12, 2010 Share Posted August 12, 2010 Sorry, I didn't really read the post. Just use the html equivalents [ ] maybe? Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/#findComment-1098414 Share on other sites More sharing options...
Kyrislian Posted August 12, 2010 Author Share Posted August 12, 2010 Ah, it doesn't work either. Thanks very much for your help though! Quote Link to comment https://forums.phpfreaks.com/topic/210522-simple-question-using-or-in-an-array/#findComment-1098427 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.