In my PHP code, I set up a scope so that people can enter their information to be displayed. Information is stored in an array, and I want to make it as flexible as possible.
If I have something like ...
$myArray[]['Text'] = 'Don't want this to fail';
or
$myArray[]['Text'] = "This has to be "easy" to do";
How can I escape from an apostrophe or quote inside an array value?
thank
Edit: since there is only a one-to-one relationship, I changed my array to this structure ...
$linksArray['Link Name'] ='/path/to/link';
$linksArray['Link Name2'] ='/path/to/link2';
$linksArray['Link Name2'] ='/path/to/link3';
In terms of plan, I set up a template with an included file that has these links in a format that someone else (a less technical person) can support. They will have direct access to PHP, and I'm afraid that they can put one or two quotes in the "link name" area and break the system.
Thanks again.
POSSIBLE SOLUTION:
@Tim Cooper.
, ...
$link = "http://www.google.com";
$text = <<<TEXT
Don't you loving "googling" things
TEXT;
$linksArray[$text] = $link;