PHP Double Quotes In Array Key

maraticscor

New Member
I know this is really bad practice, but it's already been put in place because it is an existing system. Anyways, I have a table that has an id and a description. What the code does is it creates an array from this table, but to make it easy to search, we made the description they key and the id the value. Now the issue is that the description contains double quotes, example 4"x6", and that is preventing the program from finding the id. Is there any special escape sequence that I can use to get around this issue?Here is an example of simplified code:\[code\]$my_ary = array('4"x6"'=>22, 'test'=>3);echo $my_ary['4"x6"']; // Does not workecho $my_ary['test']; // Works$quote_key = '4"x6"';echo $my_ary[$quote_key]; // Does not work\[/code\]Hopefully with that example that will help out my explination. this is with version 5.2.6-3ubuntu4.2 of PHP
 
Back
Top