Not really a WordPress question, but I’ll bite.
That data is JSON. To manipulate it with PHP you need to decode it with json_decode()
. Then you can treat it as a PHP object.
So to access the values you’d mention, and assuming the JSON is in a variable named $json
:
$object = json_decode( $json );
$staff_name = $object->items[0]->staff_name;
$coupon = $object->coupon;
Related Posts:
- Storing Array from returned database query and using the array in a new query
- Unserializeing multiple column values that are stored in one database results variable
- save array of objects with update_option
- How to return number of found rows from SELECT query
- How do I make an HTML table from a database table?
- what is the use of /wp-includes/SimplePie?
- How to check if image is already stored in a site’s post database? (network)
- Inserting dynamic content into a page
- Check if post of title already exists
- Sorting list of sites from multisite network using wp_get_sites
- How to export/import theme customizer settings?
- $wpdb->delete column values IN ARRAY()?
- How to store the_title() into a variable to reutrn the value, not just echo it
- Metabox repeating fields – radio buttons not saving correctly
- Inserting choice in database table
- How can merge two arrays values in one array and save in database
- WP API V2 returning Invalid User ID
- How To Make Connection To WordPress Data Base In A Plugin?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- Changing user_nicename
- Does WordPress cache get_user_meta() results?
- How to auto login user again after change user_login
- WordPress will not operate correctly
- Export User Info to CSV from Front End
- How to Join two tables from separate databases within WordPress
- How to update single value in multi dimensional Post Meta?
- WordPress admin never finishes saving page on site with large page count
- Retrieving and Displaying Data From a Table
- Refresh page after update_post_meta
- Search and Replace in database: How to replace data in SQL dump file on Windows?
- Duplicate domain database to local – How?
- Error in WP_update_post
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- How can I call a row of user specific data from a custom table added to the WP Database
- Compare two meta key values against each other inside the get_posts array?
- How to merge local and live databases?
- How to track a users progress through pages by inserting data into WordPress Database?
- Why WordPress uses 4 tables to manage terms
- Import 10,000 Users into WordPress WITH a specific ID for each user
- WPDB: how to get the value of a field in a custom database table
- Looping through WP_Post Object
- Need to get specific data from array
- WP database error for comments_popup_link()
- if statement on database query
- Notice: wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- Using a javascript file to access a get posts array
- Create an array from an array
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- WP_User_Query order by meta_key that is an array
- No wp-config.php file on local install of wordpress – site still displays
- How to create Sub Sub domain Multi User blogs?
- Generate an array of parent/child page IDs, based on parent page name
- How to find the output of contact form 7 shortcode? [closed]
- How do I output a database option that is an array into a get_posts array?
- Issue with foreach on duplicate meta_key’s
- Can an array be used as a meta_query value?
- Access/update database with jQuery
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- How do I dynamically generate args for wp_query?
- List of posts by day of the week
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Check if term object is in array
- Different database query in function.php using mysqli
- How to generate page content from database the right way?
- Must Use Plugin Causing Query Error
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Add custom php database code above
- ‘orderby’ => ‘rand’ alternative for better performance?
- How to convert objects into arrays
- wp_insert_post not working
- Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool
- Parsing php string in jquery [closed]
- Store and Work with huge array in WP [closed]
- Admin Options page. Save as Array
- phpMyAdmin displays error when importing database
- Prevent Data Resubmission On Page refresh
- PHP get the first post separately from array returned by wpdb->get_results()
- Working with query_posts ( arrays and query strings)
- Adding Custom Forms
- SQL QUERY – Select a value directly from the database
- how can i show only the parents in owl-carousel?
- Create shortcodes within foreach loop (using array)
- How to get the POST TITLE using the POST ID?
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- Is it necessary to sanitize wp_set_password user input?
- Using a variable in is_page(array())
- Any possible way to make $wpdb->get_results() return anything else than array?
- Remove duplicates – array_unique()
- database interactions using OOP
- How can I add multiple ‘tax_query’ arrays via a loop?
- WordPress Scheduled Event Request Blocking
- Transferring working local PHP site to wordpress – with database (MySQL)
- How to properly loop through these external URLs to get them into the sitemap using this hook
- Accessing the database from a plugin outside of action hooks
- Trying to establish connection to External Database
- Recent posts with featured image or fallback image with permalink
- Create WP_Query to search for posts by their categories or their parent/child categories