How do I get a PHP array to an angular variable? -
i'm coding website uses php information match database array. however, want display information using angular. how array php angular?
you can have php output information json object on different page.
http://example.com/matchdata.php
<?php header('content-type: application/json'); echo json_encode($match); ?>
then use angular fetch data
http://example.com/display.html
<script> // matchctrl $http.get('http://example.com/matchdata.php').then(function(response){ $scope.matchdata = response; }) </script> <html> <div ng-controller="matchctrl"> {{matchdata}} </div> <html>
Comments
Post a Comment