Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8063633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:06:27+00:00 2026-06-05T11:06:27+00:00

i am using php. i am having trouble with getting my output to work.

  • 0

i am using php. i am having trouble with getting my output to work. i am scraping html with yql so my json files aren’t exactly perfect. for example,

{
 "td": [
  {
   "a": {
    "class": "audioPlayer",
    "href": "http://files.emfcdn.com/downloads/audio/hooks/3567.mp3",
    "img": {
     "border": "0",
     "class": "audioPlayer",
     "height": "22",
     "onmouseout": "this.src='/images/music/songplay-norm.jpg'",
     "onmouseover": "this.src='/images/music/songplay-over.jpg'",
     "src": "/images/music/songplay-norm.jpg",
     "width": "30"
    }
   }
  },
  {
   "p": "2."
  },
  {
   "img": {
    "alt": "Mandisa",
    "id": "ctl00_ctl00_cphMain_cphMiddleColumn_grdSongs_ctl03_imgAlbum",
    "src": "http://objects.klove.com/Common/Thumbnail.aspx?f=/art/albumart/1704.jpg&s=58&",
    "style": "border-width:0px;"
   }
  },
  {
   "a": {
    "href": "/music/artists/mandisa/songs/good-morning-(feat.-tobymac)-lyrics.aspx",
    "id": "ctl00_ctl00_cphMain_cphMiddleColumn_grdSongs_ctl03_hypTitle",
    "style": "font-weight:bold;",
    "content": "Good Morning (feat. tobyMac)"
   },
   "br": null,
   "p": {
    "a": {
     "href": "/music/artists/mandisa/",
     "id": "ctl00_ctl00_cphMain_cphMiddleColumn_grdSongs_ctl03_Hyperlink1",
     "content": "Mandisa"
    },
    "content": "by "
   }
  },
  {
   "p": "What If We Were Real"
  },
  {
   "style": "width:110px;",
   "a": {
    "href": "http://click.linksynergy.com/fs-bin/stat?id=SUbYnR25dhw&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252Fus%252Falbum%252Fid425892874%253Fi%253D425892890%2526uo%253D4%2526partnerId%253D30",
    "id": "ctl00_ctl00_cphMain_cphMiddleColumn_grdSongs_ctl03_hypItunes",
    "target": "_blank",
    "content": "iTunes"
   },
   "p": {
    "a": {
     "href": "http://www.amazon.com/exec/obidos/ASIN/B004SBW1LS/klr-20/ref=nosim/",
     "id": "ctl00_ctl00_cphMain_cphMiddleColumn_grdSongs_ctl03_hypAmazon",
     "target": "_blank",
     "content": "Amazon"
    },
    "content": "| "
   }
  }
 ]
}

, this is one of my items from my html scrape from a website with yql. i want to variable to echo, “What If We Were Real”. but the json objects title is “p”, and i dont know how to extract “What If We Were Real” from that.

ive tried,

$albumname = $item->p

, but as you can see there are multiple “p”‘s in the list. any help would be great. thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:06:29+00:00Added an answer on June 5, 2026 at 11:06 am

    the first thing when im coming against such monsters i simply do this:

    $estr = json_decode($str,TRUE);
    echo "<pre>";
    print_r($estr);
    echo "</pre>";
    

    then its easy to find that:

    echo $estr["td"][4]["p"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using HTML Purifier in my PHP project and am having trouble getting
I’m having trouble getting a AJAX/JSON function to work correctly. I had this function
I’m having trouble getting a AJAX/JSON function to work correctly. I had this function
I'm having trouble getting the results of a has_many query using php idiorm/paris. Following
I'm having trouble using PHP to SFTP upload files to a remote server. When
Having trouble getting a form using PHP, JQuery Form plugin, and JQuery Validate plugin
I'm having trouble getting PHP's session_regenerate_id() to work in an application I'm developing. The
I'm having trouble with debugging a PHP project through NetBeans using XDebug, and was
I've been trying to resize an image using php but I'm having issues getting
I'm new to using SSL Certs and am having trouble getting help from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.