Php String Loop Through Object Properties In Javascript