Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to echo stdClass Object Title

Tags:

php

mysql

What I want is echo the title only.

The below command is printed by the following trigger:

print_r($results);

Array ( 
   [0] => stdClass Object ( [title] => Title A [catid] => 1 ) 
   [1] => stdClass Object ( [title] => Title B [catid] => 1 ) 
) 

How can I echo just Title A

Kind regards!

like image 560
WNR Design Avatar asked Oct 25 '25 01:10

WNR Design


1 Answers

It's just an array of objects, so...

$results[0]->title
like image 194
Marc B Avatar answered Oct 27 '25 15:10

Marc B