Dealing with special characters in object property names
You can do that in one expression:
echo $obj->{'Revenues_(budget)'};
Special characters in property name of object
echo $myobject->{'%myproperty'};
Use special characters in object property name
by using variables variable as follows :
print_r($xml->{"reservation-details"});
consider the following example:
$ar = json_decode('{"var": "message", "var-1": "yello"}');
print_r($ar->{"var-1"});
Output : yello
live demo https://3v4l.org/ICTGZ
How to access property of javascript object with special character in property name
AngularJS does nothing special here. Refer to the regular rules for referencing properties in a javascript object.
In a controller: console.log($scope.data['Handedness;'])
In a view: {{ data['Handedness;'] }}
Object properties with special characters in EJS
Pass an object instead, then access properties on it.
res.render('index.ejs', { replace })
<%= replace['x:a'] %>
<%= replace['x:b'] %>
<%= replace['y:c.d'] %>
Special characters in property name
You can make class objects from json using following references
http://json2csharp.com/
Just paste your json string and it will generate C# class and properties inside that json.
JavaScript destructuring object containing fields with special characters
You could take a computed property and a new variable name.
let arr = [{ '@type': 'Something', data: 1234 }, { '@type': 'Something', data: 3214 }];
for (const { data, ['@type']: renamed } of arr) { console.log(renamed);}
Related Topics
Supplied Argument Is Not a Valid MySQL Result Resource
Printing a New Line in a CSV File Cell
HTML into PHP Variable (HTML Outside PHP Code)
PHP Loop: Add a Div Around Every Three Items Syntax
Utf8 Filenames in PHP and Different Unicode Encodings
Cannot Call Function SQLsrv_Connect()
Php, Failed Connecting to Database
Best Way to Do a Weighted Search Over Multiple Fields in MySQL
Replace &Nbsp; Characters That Are Hidden in Text
PHP - Getsqlvaluestring Function
PHP String in Array Only Returns First Character
How to Insert Multiple Rows Using Prepared Statements
Apache Permissions, PHP File Create, Mkdir Fail
What Http Status Code Is Supposed to Be Used to Tell the Client the Session Has Timed Out
What Is Unexpected T_Variable in PHP