Jump to content

How does filtering work?


musicmaster

Recommended Posts

I am trying to figure out how filtering works.

 

In the database I see this kind of text as the implementation of a filter: 

a:6:{s:10:"categories";a:1:{i:0;i:100;}s:9:"shop_list";a:1:{i:0;i:1;}s:31:"layered_selection_subcategories";
a:2:{s:11:"filter_type";i:0;s:17:"filter_show_limit";i:4;}s:30:"layered_selection_manufacturer";a:2:{s:11:"filter_type";
i:1;s:17:"filter_show_limit";i:0;}s:24:"layered_selection_feat_5";a:2:{s:11:"filter_type";i:2;s:17:"filter_show_limit";i:0;}
s:24:"layered_selection_feat_8";a:2:{s:11:"filter_type";i:0;s:17:"filter_show_limit";i:0;[spam-filter]

Does anyone know what it means or where I can find what it means?

Edited by musicmaster (see edit history)
Link to comment
Share on other sites

It's serialized array() when PHP grab it from DB it run unserialize() function:

<?php
$a = unserialize('a:6:{s:10:"categories";a:1:{i:0;i:100;}s:9:"shop_list";a:1:{i:0;i:1;}s:31:"layered_selection_subcategories";a:2:{s:11:"filter_type";i:0;s:17:"filter_show_limit";i:4;}s:30:"layered_selection_manufacturer";a:2:{s:11:"filter_type";i:1;s:17:"filter_show_limit";i:0;}s:24:"layered_selection_feat_5";a:2:{s:11:"filter_type";i:2;s:17:"filter_show_limit";i:0;}s:24:"layered_selection_feat_8";a:2:{s:11:"filter_type";i:0;s:17:"filter_show_limit";i:0;[spam-filter]');
echo '<pre>';
print_r($a);
?>

// so it got that array
Array
(
    [categories] => Array
        (
            [0] => 100
        )

    [shop_list] => Array
        (
            [0] => 1
        )

    [layered_selection_subcategories] => Array
        (
            [filter_type] => 0
            [filter_show_limit] => 4
        )

    [layered_selection_manufacturer] => Array
        (
            [filter_type] => 1
            [filter_show_limit] => 0
        )

    [layered_selection_feat_5] => Array
        (
            [filter_type] => 2
            [filter_show_limit] => 0
        )

    [layered_selection_feat_8] => Array
        (
            [filter_type] => 0
            [filter_show_limit] => 0
        )

)
Edited by Piotr Kaczor (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...