PHP Get Array Value from JSON Not working [duplicate]

302
May 09, 2017, at 11:20 AM

This question already has an answer here:

  • Parsing JSON file with PHP 14 answers
  • How do I extract data from JSON with PHP? 2 answers

I want to get the URLS from the JSON below.

$jsonArray = {
     "uuid": "signed",
    "PreSigned": "{'url': ['www.g.com', 'www.o.com']"}

I tried this $jsonArray -> PreSigned[0]->url

And it didn't work

Answer 1

Try this: this ll give you array of urls

var_dump($jsonArray->PreSigned->url);
Rent Charter Buses Company
READ ALSO
How can I dynamically change the price of a Product based on the amount of characters entered into a Custom Field by a Shopper?

How can I dynamically change the price of a Product based on the amount of characters entered into a Custom Field by a Shopper?

I am currently working on a WordPress website, with WooCommerce functionalityOn the Product Page, I have created a Custom Field, which allows shoppers to enter a piece of text that they would like to appear on the associated product

208
Laravel JWT : generated tokens on the localhost are valid on the server

Laravel JWT : generated tokens on the localhost are valid on the server

im writing api for a mobile app , the backend website is written in laravel

342
How to save onpaste image with a src of “data:image/png;base64,…” using php

How to save onpaste image with a src of “data:image/png;base64,…” using php

I'm trying to save the pasted image into a folder and the relevant details to the database, but my current code is not saving the pasted image, I try to put a hard coded url on the src attribute and it was working

365
Not entering if condition in Php mySQL [on hold]

Not entering if condition in Php mySQL [on hold]

I can't figure out why my if statement isn't running after I submit the form

245