تابع ووکامرسی wc_string_to_bool تبدیل رشته به بولین

تابع ووکامرسی wc_string_to_bool – تبدیل رشته به بولین
Syntax – سینتکس
wc_string_to_bool( (string) $string );
Parameters – پارامتر ها (1)
- 1- $string (string)
Usage – نحوه استفاده
if ( !function_exists( 'wc_string_to_bool' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php'; } // The string. $string = ''; // NOTICE! Understand what this does before running. $result = wc_string_to_bool($string);
Defined – محل تعریف
/includes/wc-formatting-functions.php
function wc_string_to_bool( $string ) { return is_bool( $string ) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string ); }
versions – نسخه ها
از نسخه : 3.0.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر