Skip to content

How do you pull this value out of a stdClass Object?

How do I pull the value of the workers, I want the result “iamdamnsam.L3”. I tried $data->workers[0]; but that didn’t work. I am using json_decode() to get $data Answer Let’s say there are/will be more workers. Then you can loop the object of all workers by converting the Object to …

How to use session without using $_SESSION in wordpress

I am trying to create a session without using php $_SESSION variable and without letting user to log in on the website. I created a form and once a visitor/guest user submit the form, I want to store his data in a session variable. I found that using $_SESSION is not a good practice in wordpress. I looked aro…

Updating multiple tables in SQL using an Array

Currently I had a table called crm_leads for my Leads page where I already have many records. Now for the same page I have created few new fields which is now going to be stored in another table called crm_leads_details. Now I’m storing all my POST values in an array format like so: Now in my model I&#8…

Composition vs Aggregation in PHP

I was reading an article about relationships in OOP, association, composition, aggregation, etc. Something is confusing & I keep finding conflicting information online so I hope that someone can shed some light on this. So in PHP, we call the following code composition & a lot of articles/tutorials po…

Convert to accordion

I’m new here. I’m trying to convert my <li> into an accordion in the mobile view. I actually have something similar to: And I have this on the footer.php But it shows me “Uncaught TypeError: oTab is undefined” So every time I click on the li it displays the related div descriptio…