S
S
Stalker_darkway2015-10-28 04:08:21
PHP
Stalker_darkway, 2015-10-28 04:08:21

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

2 answer(s)
N
Nazar Mokrinsky, 2015-10-28
@hronik87

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"];

And compare the output.

I
Immortal_pony, 2015-10-28
@Immortal_pony

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 question

Ask a Question

731 491 924 answers to any question