# Mecha CMS

Helper functions.

## `e`

Try to evaluate string to the proper data type.

2.0.0

``````e(\$value, array \$lot = []);
e(array \$values, array \$lot = []);``````

Example:

``````// Evaluate data from `\$_GET`
\$data = e(\$_GET);
// Evaluate `yes` and `no` string as well
\$data = e(\$_GET, [
'yes' => true,
'no' => false,
'YES' => true,
'NO' => false,
]);``````

This function does the following tasks:

• Convert numeric string to integer if string does not contains `'.'` character.
• Convert numeric string to float if string contains `'.'` character.
• Convert JSON string to real PHP values (will be converted to plain array if JSON is an object).
• Convert `'true'` string to real `true` value.
• Convert `'false'` string to real `false` value.
• Convert `'null'` string to real `null` value.
• Convert `'TRUE'` string to real `true` value.
• Convert `'FALSE'` string to real `false` value.
• Convert `'NULL'` string to real `null` value.
• Unwrap string value from single and double quotes if the JSON evaluation has been failed to perform, so that the string value will not be evaluated. This is useful if you want to make sure that the parser will not evaluate your `'true'` value by surrounding the string value with single or double quotes like `'\'true\''` or `'"true"'`.
{"ft_lang_label":"__label__en","ft_lang_prob":0.55478084,"math_prob":0.92993855,"size":1173,"snap":"2021-43-2021-49","text_gpt3_token_len":291,"char_repetition_ratio":0.20444825,"word_repetition_ratio":0.06,"special_character_ratio":0.27877238,"punctuation_ratio":0.12903225,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9722732,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-18T00:45:12Z\",\"WARC-Record-ID\":\"<urn:uuid:809839a7-fd11-4772-9632-9997f48cb9c3>\",\"Content-Length\":\"16075\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3bc6fefd-c5dd-45b9-9f37-8d722d641176>\",\"WARC-Concurrent-To\":\"<urn:uuid:f3a9f3a6-12d0-487b-a2d8-495cf859faba>\",\"WARC-IP-Address\":\"104.21.57.208\",\"WARC-Target-URI\":\"https://mecha-cms.com/reference/function/e\",\"WARC-Payload-Digest\":\"sha1:2NUXEJZKM3CSSA3PIE772QCIZ3DRL3PT\",\"WARC-Block-Digest\":\"sha1:FFYEDPCOI4VUNOXPXWZMGROXXOB6Q67L\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585186.33_warc_CC-MAIN-20211018000838-20211018030838-00158.warc.gz\"}"}