[ create a new paste ] login | about

Link: http://codepad.org/KhofwXCi    [ raw code | output | fork ]

PHP, pasted on Dec 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php 

$x_axis = array(
'Safari', 'Opera', 'fireFox'
);

$y_axis = array(
10, 30.4, 50
);
    $d = array();
    foreach($x_axis as $key=>$x) {
        $d[] = "['" . $x . "', " . $y_axis[$key] . "]";
    }
    echo json_encode($d);


Output:
1
["['Safari', 10]","['Opera', 30.4]","['fireFox', 50]"]


Create a new paste based on this one


Comments: