I'm working with JavaScript and PHP right now. My JavaScript uses camelCase while my PHP uses under_score for variable/object/array naming.
I often have JavaScript send data to PHP. In fact it's specially made to send to PHP.
So, my question is, should I write the data being sent to PHP by JavaScript in camelCase or under_score?
Also vice versa.
Heres an example
Javascript -> PHP
var fooBar = {firstName:"Daenerys",lastName:"Targaryen",titles:{...}};
PHP receives
var foo_bar = $_POST['fooBar'];
// this is where the problem arises
foo_bar['firstName'];
foo_bar['lastName'];
Edit: It's not a duplicate because I'm not asking whether the code should have the same code conventions, but which code convention takes precedence when communicating between each other.