Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyword Comperator (functionality) #11

Closed
dud3 opened this issue Oct 3, 2014 · 2 comments
Closed

Keyword Comperator (functionality) #11

dud3 opened this issue Oct 3, 2014 · 2 comments

Comments

@dud3
Copy link
Owner

dud3 commented Oct 3, 2014

Description

Compare keywords from the email against those assigned to the email address list on the DB.

@dud3 dud3 self-assigned this Oct 3, 2014
@dud3 dud3 added this to the M-W-2 milestone Oct 3, 2014
@dud3 dud3 changed the title Keyword populator (functionality) Keyword Comperator (functionality) Oct 8, 2014
@dud3
Copy link
Owner Author

dud3 commented Oct 9, 2014

Code notes:
Note that when getting the associative array from the DB all elements must contain keys otherwise json_decode() will throw a "syntax error" or similar.

  $keywords =  explode(" ", $data);

        $k_db = keywords_list::all()->toArray();

        var_dump($k_db[0]["keywords"]);

        $jf = (string)$k_db[0]["keywords"];

        var_dump($jf);

        // $json_a = json_encode($jf, true);
        trim($jf);

        $json_a = json_decode($jf, true);

         switch (json_last_error()) {
        case JSON_ERROR_NONE:
            echo ' - No errors';
        break;
        case JSON_ERROR_DEPTH:
            echo ' - Maximum stack depth exceeded';
        break;
        case JSON_ERROR_STATE_MISMATCH:
            echo ' - Underflow or the modes mismatch';
        break;
        case JSON_ERROR_CTRL_CHAR:
            echo ' - Unexpected control character found';
        break;
        case JSON_ERROR_SYNTAX:
            echo ' - Syntax error, malformed JSON';
        break;
        case JSON_ERROR_UTF8:
            echo ' - Malformed UTF-8 characters, possibly incorrectly encoded';
        break;default:
            echo ' - Unknown error';
        break;    }

        echo PHP_EOL;

        var_dump($json_a);

        $string='{"name":"John Adams"}';

        var_dump($string);

        $json_b=json_decode($string,true);

        var_dump($json_b);

        var_dump($keywords);

@dud3
Copy link
Owner Author

dud3 commented Oct 11, 2014

The core of the keyword comparator and filter is there.
Closing this for now.

Open a new one for advancing the filter.

@dud3 dud3 closed this as completed Oct 11, 2014
dud3 added a commit that referenced this issue Nov 19, 2014
Resolves: #11
Releases: master
@dud3 dud3 added the ver: 1.1 label Nov 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant