Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- ini_set('display_errors', 'On');
- mb_internal_encoding('utf-8');
- function getData(){
- $data = '[{
- "firstName": "Иван",
- "lastName": "Иванов",
- "address": "г.Москва, ул. Алиева,2",
- "phoneNumber": "812 143-2534"
- }, {
- "firstName": "Вася",
- "lastName": "Пупкин",
- "address": "г.Воронеж, ул. Пушкина,11",
- "phoneNumber": "812 123-1234"
- }, {
- "firstName": "Сергей",
- "lastName": "Попов",
- "address": "г.Пермь, ул. Савина,30",
- "phoneNumber": "812 321-1444"
- }]';
- return $data;
- }
- $decode = file_get_contents(getData());
- $decode2 = json_decode($decode);
- echo '<pre>';
- var_dump($decode2);
- echo '</pre>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement