I need an escape sequence for -
or the minus sign for php. The object has a name-value pair where the name happens to be having -
between 2 words.
I can't do this using \
the standard escape sequence (-
isn't anyways documented).
I can store the name in a $myvariable
which can be used but out of curiosity is it possible to do the following?
$myobject->myweird-name
This gives an Error because of -
If you need to look up an index, there are a couple of ways of doing it:
If you need to work within a string (which is not your best idea, you should be using manual concatenation where possible as it is faster and parsed strings is unnecessary), then you should use {} to basically escape the entire sequence:
Since you mentioned that this is LinkedIn's API which, I believe, has the option of returning XML, it might be faster (and possibly cleaner/clearer) to use the XML method calls and not use the objects themselves. Food for thought.
This is what you need: