Class Object Array Php Format String Javascript Substring