0

I have a strange problem; I have a variable, as follows:

$postBSGlobal = $post['Post']['B/S']

Which, when debugged, correctly delivers

"B"

But, later on the value magically changes to

"1"

Without me manipulating the variable in any way.

I need the string-value for this statement:

if ($userId <> $post['Post']['OWNER'] && $postBSGlobal = 'B'){
    echo "Dein Verdienst:";
};

Today my app is completely unusable due to this problem. Maybe the PHP-version on my managed server has changed? How can I prevent PHP from returning the "1"?

1 Answer 1

1

You used a single = instead of ==. Change it to:

$postBSGlobal == 'B'

Sign up to request clarification or add additional context in comments.

2 Comments

@Karl Can you show the code where it's outputting "1"? While the single instead of double equal is a problem, it wouldn't change the value to 1...that must be happening further down in your script.
Jesus, you saved my life! It was in correspondence with H = '0' statements which blew up some certain branches ... Thanks!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.