Answer the question
In order to leave comments, you need to log in
How to get the value of an array?
Hello.
Here is the print_r result of $arResult:
Array
(
[0] => Array
(
[TEXT] => Power tool
I write this:
<?if($arResult["TEXT"] == 'Power tool'):?>
<? echo ' GOOD'; ?>
<?endif;?>
What am I doing wrong How do I get to this word(power tool)
Thanks in advance for your reply
guys, I understand... this is a dumb question, but I can't figure out why not displayed (
Answer the question
In order to leave comments, you need to log in
The answer to your second question about the inequality - they are equal, if not - the problem is in the encoding, try to output:
echo 'Электроинструмент<br>';
echo $arResult[0]["TEXT"];
The "TEXT" element lies in the "0" element of the "$arResult" array.
You can get to it like this:$arResult[0]["TEXT"];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question