acf_str_exists()ACF 5.0.0

acf_str_exists

This function will return true if a sub string is found

No Hooks.

Returns

(true|false).

Usage

acf_str_exists( $needle, $haystack );
$needle(required)
.
$haystack(required)
.

Changelog

Since 5.0.0 Introduced.

acf_str_exists() code ACF 6.8.8

function acf_str_exists( $needle, $haystack ) {

	// return true if $haystack contains the $needle
	if ( is_string( $haystack ) && strpos( $haystack, $needle ) !== false ) {
		return true;
	}

	// return
	return false;
}