Hello I have to create the following Array
{{x: 140224, y: 50.1},{x: 140225, y: 50.0},{x: 140226, y: 50.0},{x: 140227, y: 50.0},{x: 140228, y: 50.1},{x: 140229, y: 50.0},{x: 140230, y: 50.0},{x: 140231, y: 50.0},{x: 140232, y: 50.0},{x: 140233, y: 50.0},{x: 140234, y: 50.0},{x: 140235, y: 50.0},{x: 140236, y: 50.0},{x: 140237, y: 50.0},{x: 140238, y: 50.0},{x: 140239, y: 50.0},{x: 140240, y: 50.0},{x: 140241, y: 50.0},{x: 140242, y: 50.0},{x: 140243, y: 50.0},{x: 140244, y: 50.0}}
without the first { element[0] and the last } so it should look like this
{x: 140224, y: 50.1},{x: 140225, y: 50.0},{x: 140226, y: 50.0},{x: 140227, y: 50.0},{x: 140228, y: 50.1},{x: 140229, y: 50.0},{x: 140230, y: 50.0},{x: 140231, y: 50.0},{x: 140232, y: 50.0},{x: 140233, y: 50.0},{x: 140234, y: 50.0},{x: 140235, y: 50.0},{x: 140236, y: 50.0},{x: 140237, y: 50.0},{x: 140238, y: 50.0},{x: 140239, y: 50.0},{x: 140240, y: 50.0},{x: 140241, y: 50.0},{x: 140242, y: 50.0},{x: 140243, y: 50.0},{x: 140244, y: 50.0}
The code I have to produce this string:
$arraytime[] = array('x: ' . $measurement[2] . ', y: ' . $measurement[12]);
$js_arraytime = json_encode($arraytime);
$js_arraytime = str_replace('"', '' ,$js_arraytime);//
$js_arraytime = str_replace("[", '{', $js_arraytime);
$js_arraytime = str_replace("]", '}', $js_arraytime);
echo $js_arraytime;
if i try to replace $js_arraytime[0] with something else every first element of an array is changing. Can someone please help me out