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 9005309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:06:37+00:00 2026-06-16T01:06:37+00:00

This is the var_dump: object(stdClass)#27 (8) { [SETTING_ID]=> string(2) 25 [SETTING_SOURCE]=> string(2) XV [SETTING_FLEET]=>

  • 0

This is the var_dump:

object(stdClass)#27 (8) { 
    ["SETTING_ID"]=> string(2) "25" 
    ["SETTING_SOURCE"]=> string(2) "XV" 
    ["SETTING_FLEET"]=> string(3) "313" 
    ["SETTING_EXAM"]=> string(1) "A" 
    ["SETTING_HIDE"]=> string(1) "0" 
    ["SETTING_THRESHOLD"]=> string(1) "0" 
    ["SETTING_COUNT"]=> string(8) "POSITIVE" 
    ["SETTING_USAGE"]=> string(7) "MILEAGE" 
} 

The variable I am testing is SETTING_HIDE. This is being pulled from MySQL using the Code igniter framework. I don’t know if it is just me being thick after a rather long day at work or what, but no matter what value the variable holds, any if statement made against it returns true, even when typecast as a boolean or a direct string comparison, ie. == “0” or == “1”.

Anyone with a fresh pair of eyes care to make me feel silly!?! 🙂

Just to clarify:

Have tried the following:

if($examSetting->SETTING_HIDE == "1") {  $showOnABC = "checked=\"checked\""; } 
if((bool)$examSetting->SETTING_HIDE) {   $showOnABC = "checked=\"checked\""; }



if($examSetting->SETTING_COUNT == "POSITIVE") further on in my code works perfectly.
  • 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-16T01:06:39+00:00Added an answer on June 16, 2026 at 1:06 am

    I think it’s just one of those weird annoying things, but,

    if($examSetting->SETTING_HIDE == "1") {
    $showOnABC = "checked=\"checked\"";
    } else {
    $showOnABC = "";
    }
    

    now works exactly as expected.

    Thanks for looking anyhow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My var_dump($gallery) looks like this: array(1) { [0]=> object(stdClass)#102 (9) { [term_id]=> string(2) 17
I have an array like this (below is the var_dump) array 0 => object(stdClass)[11]
I have this output when I do var_dump($myvar) on a variable. object(stdClass)#5 (19) {
I have a SOAP response whose var_dump looks like this: object(stdClass)[14] public 'GetClientsResult' =>
Why does this: <? var_dump ( json_decode('{unicode:\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8}') ); ?> give me: object(stdClass)#1 (1) {
Here is my string $newPath = '/~new/assets/js/../packages/prettyphoto/js/jquery.prettyPhoto.js'; Now check this output var_dump($newPath); // string(64)
Having an object like this: var a = { b: string, c: function(){ return
I have this: [1]=> object(SimpleXMLElement)#6 (1) { [@attributes]=> array(14) { [name]=> string(5) MySQL [acknowledged]=>
So in my code I have: var_dump($poll); which prints: object(stdClass)#2 (9) { [parent]=> object(stdClass)#3
I have an object as this: object(stdClass)#27 (1) { [0] => object(stdClass)#26 (6) {

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.