Skip to content
Advertisement

Tag: var-dump

Display SQL query result on front-end WordPress site

I am trying to get the total data (SUM) within a column in a Wordpress database. I am using the following SQL (and PHP) code to run the request; however, I do not know how to display the result on the front end of my site. or I have tried using print_r($avg_items_purchased); and var_dump($avg_items_purchased); but it outputs more information than

Visually same string gives different var_dumps in php

UPDATE: Anwer is here PHP unserialize fails with non-encoded characters? I’m trying to match objects with in_array. This works fine except for the object with this string as a property. Visually they are the same, but when I do a var_dump PHP sees different lengths. var_dump results: What can be the cause? Some ascii value I don’t know of? Answer

Make var_dump look pretty

I have a simple $_GET[] query var set for showing testing data when pulling down queries from the DB.

Advertisement