[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Вывод значений из массива
vasamen
Всем привет! И это снова я =))
Никак не могу вывести из массива данные!

    $results = json_decode($rsp);

вывожу на страницу:
    print_r($results);


Получаю на странице просто массив:

stdClass Object 
(
[
bossresponse] => stdClass Object
( [responsecode] => 200
[web] => stdClass Object
(
[
start] => 0 [count] => 48
[totalresults] => 89100000
[results] => Array
(
[
0] => stdClass Object
(
[
date] => [clickurl] => http://en.wikipedia.org/wiki/Test
[url] => http://en.wikipedia.org/wiki/Test
[dispurl] => en.wikipedia.org/wiki/Test
[title] => Test - Wikipedia, the free encyclopedia
[abstract] => Test, TEST or Tester may refer to: Test (assessment), an assessment intended to measure the respondents knowledge or other abilities Contents 1 Science
)
[
1] => stdClass Object
(
[
date] => [clickurl] => http://www.speedtest.net/
[url] => http://www.speedtest.net/
[dispurl] => www.speedtest.net
[title] => Speedtest.net by Ookla - The Global Broadband Speed Test
[abstract] => Test your Internet connection bandwidth to locations around the world with this interactive broadband speed test from Ookla
)
[
2] => stdClass Object
(
[
date] => [clickurl] => https://www.test.com/
[url] => https://www.test.com/
[dispurl] => https://www.test.com
[title] => Test
[abstract] => Test
)
[
3] => stdClass Object
(
[
date] => [clickurl] => http://www.speakeasy.net/speedtest/
[url] => http://www.speakeasy.net/speedtest/
[dispurl] => www.speakeasy.net/speedtest
[title] => Speakeasy Speed Test - Powered by MegaPath
[abstract] => Speakeasy, a MegaPath Brand, offers industry leading business voice, data and IT solutions. We ensure the speed, performance and reliability of all our services by ...
)
[
4] => stdClass Object
(
[
date] => [clickurl] => http://dictionary.reference.com/browse/test
[url] => http://dictionary.reference.com/browse/test
[dispurl] => dictionary.reference.com/browse/test
[title] => Test | Define Test at Dictionary.com
[abstract] => test your knowledge of the rapper, producer, and businessman with this weeks quiz. Everything you do in a meritocratic society is some kind of test, and there is ...
)
[
5] => stdClass Object
(
[
date] => [clickurl] => http://similarminds.com/personality_tests.html
[url] => http://similarminds.com/personality_tests.html
[dispurl] => similarminds.com/personality_tests.html
[title] => Personality Tests and Tools - Personality Test Site
[abstract] => home | contact | info | forum arcoxia online stores **Jung tests are similar in underlying theory to Myers-Briggs typology (of which this site has no affiliation)
)
[
6] => stdClass Object
(
[
date] => [clickurl] => http://www.thefreedictionary.com/test
[url] => http://www.thefreedictionary.com/test
[dispurl] => www.thefreedictionary.com/test
[title] => test - definition of test by The Free Dictionary
[abstract] => test 1 (tĕst) n 1 A procedure for critical evaluation; a means of determining the presence, quality, or truth of something; a trial: a test of ones eyesight ...
)
[
7] => stdClass Object
(
[
date] => [clickurl] => http://www.ets.org/
[url] => http://www.ets.org/
[dispurl] => www.ets.org
[title] => ETS Home
[abstract] => Assessment development and research organization. Directory of tests for a variety of age groups and subjects. Information for applicants with disabilities, research ...
)

и т.д.


но мне нужно вывести на страницу просто:
данные из:
[url]
[dispurl]
[title]
[abstract]

делал так:
foreach ($results as $theresult) {
echo '<a href="'.$theresult->clickurl.'">'.$theresult->title.'</a><br/>';
echo $theresult->abstract.'<br/>';
echo '<small><i>'.$theresult->dispurl.'</i></small><br/>';
echo '<br/><br/>';


ничего не помогло просто белая страница!
банально так:
echo $results->results[0]->title;

тоже ничего...... уже второй день голову ломаю почему не выходит!
Что я делаю не так???
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.