A
A
Anton2018-03-20 08:31:09
PHP
Anton, 2018-03-20 08:31:09

How to take values ​​from an array and compare with a number?

There is an array, the print outputs it like this:

// print_r($arBasketItems);

Array
(
    [0] => Array
        (
            [ID] => 40517
                  )

    [1] => Array
        (
            [ID] => 40516
                   )
  [2] => Array
        (
            [ID] => 40456
                   )

)
// и так далее

I need if
[ID]
matches with
<?=$arCurOffer['ID']?>
hide one link and show another one
Help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2018-03-20
@LiguidCool

if also has a short notation, but in general it is better to use special template engines.

S
Sanovskiy, 2018-03-20
@Sanovskiy

Describe the task in more detail.
> I need if
> [ID]
> matches
> <?=$arCurOffer['ID']?>
The context is unclear at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question