Guest User

Untitled

a guest
Feb 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. while($row = mysqli_fetch_assoc($sql)) {
  4. ....
  5. $array_tmp = array();
  6.  
  7. $array_tmp["black_0"] = $black;
  8. $array_tmp["red_1" ] = $red;
  9. $array_tmp["blue_1" ] = $blue;
  10. };
  11.  
  12. $dataset[] = $array_tmp;
  13.  
  14. echo json_encode($dataset, JSON_UNESCAPED_UNICODE);
  15.  
  16. ?>
  17.  
  18. $.ajax({
  19. ...
  20. success: function(response){
  21. dataSet = JSON.parse(response);
  22.  
  23. $.each(dataSet[0], function(key, value){
  24. var active = key.substr(key.length - 1);
  25. });
  26. }
  27. });
Add Comment
Please, Sign In to add comment