WordPress at Your Fingertips
function is not described

WP_Filesystem_Base::is_binary() public WP 2.7.0

Determines if the string provided contains binary characters.

{} It's a method of the class: WP_Filesystem_Base{}

No Hooks.


true|false. True if string is binary, false otherwise.


$WP_Filesystem_Base = new WP_Filesystem_Base();
$WP_Filesystem_Base->is_binary( $text );
$text(string) (required)
String to test against.


Since 2.7.0 Introduced.

Code of WP_Filesystem_Base::is_binary() WP 5.8.2

public function is_binary( $text ) {
	return (bool) preg_match( '|[^\x20-\x7E]|', $text ); // chr(32)..chr(127)