T
T
Tupic1232021-01-15 01:15:34
PHP
Tupic123, 2021-01-15 01:15:34

Filtering by word in Bitrix?

Made a filter inside Bitrix via $arrFilter

a class="service__link" href="section.php?SECTION_ID=15&CATEGORY=2">

?php $year = intval($_GET["CATEGORY"]); 
if ($year !== 10000000000000000) 
{ 
 $arrFilter=array("PROPERTY"=>array("CATEGORY"=>"$year")); 
} 
?>


I need filtering not by numbers, but by words, for example "vet" "ras"
But if you specify
a class="service__link" href="section.php?SECTION_ID=15&CATEGORY="vet"">

Then the browser does not see the link and, accordingly, filtering does not occur.
How to make sure that the category value is correctly inserted into the link and the php code works as it should?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2021-01-15
@Tupic123

Aren't you confused by double quotes inside other double quotes? Let's try this:

<a class="service__link" href="section.php?SECTION_ID=15&CATEGORY=vet">
Suddenly it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question