??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/am1atec.co.uk/wp-content/plugins/surerank/inc/functions/validate.php
⬅ Kembali
<?php
/**
* Validate
*
* @package surerank
* @since 0.0.1
*/
namespace SureRank\Inc\Functions;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Validate
* This class contains functions to validate the given value.
*
* @since 1.0.0
*/
class Validate {
/**
* This function checks if the given value is a string or not.
* If it is a string, it returns the string, else it returns the default value.
*
* @param mixed $value The value to check.
* @param string $default Default value to return if the given value is not a string.
* @since 0.0.1
* @return string
*/
public static function string( $value, $default = '' ) {
return is_string( $value ) ? $value : $default;
}
/**
* This function checks if the given value is empty or not.
* If it is not empty, it returns the value, else it returns the default value.
*
* @param mixed $value The value to check.
* @param string $default Default value to return if the given value is not a string.
* @since 0.0.1
* @return string
*/
public static function not_empty( $value, $default = '' ) {
return ! empty( $value ) ? $value : $default;
}
/**
* This function checks if the given value is an array or not.
* If it is an array, it returns the array, else it returns the default value.
*
* @param mixed $value The value to check.
* @param array<string, mixed>|array<int, array<string, mixed>> $default Default value to return if the given value is not an array.
* @since 0.0.1
* @return array<string, mixed>|array<int, array<string, mixed>>
*/
public static function array( $value, $default = [] ) {
return is_array( $value ) ? $value : $default;
}
/**
* This function checks if the given value is empty string or not.
* It will only return false if the value is an empty string. Not for other falsy values like 0, [], etc.
*
* @param mixed $value The value to check.
* @since 0.0.1
* @return bool
*/
public static function empty_string( $value ) {
if ( is_array( $value ) ) {
return ! empty( $value );
}
if ( ! empty( $value ) ) {
return true;
}
if ( is_bool( $value ) ) {
return true;
}
if ( is_string( $value ) && '' === trim( $value ) ) {
return false;
}
return false;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 api-utils.php
php
6.6 KB
2026-06-21 06:40
🐘 cache.php
php
18.6 KB
2026-06-21 06:40
🐘 compat.php
php
7.5 KB
2026-06-21 06:40
🐘 cron.php
php
3.3 KB
2026-06-21 06:40
🐘 defaults.php
php
14.2 KB
2026-06-21 06:40
🐘 get.php
php
6.8 KB
2026-06-21 06:40
🐘 helper.php
php
22.1 KB
2026-06-21 06:40
🐘 modified-date-lock.php
php
2.5 KB
2026-06-21 06:40
🐘 requests.php
php
1.9 KB
2026-06-21 06:40
🐘 rest-observation.php
php
2.8 KB
2026-06-21 06:40
🐘 sanitize.php
php
5 KB
2026-06-21 06:40
🐘 send-json.php
php
1.3 KB
2026-06-21 06:40
🐘 settings.php
php
24.2 KB
2026-06-21 06:40
🐘 update.php
php
4.2 KB
2026-06-21 06:40
🐘 utils.php
php
2.5 KB
2026-06-21 06:40
🐘 validate.php
php
2.3 KB
2026-06-21 06:40
🐘 variables.php
php
3.7 KB
2026-06-21 06:40