WP_Filesystem_Base::is_binary( string $text )

Determine if the string provided contains binary characters.


Parameters

$text

(string) (Required) String to test against.


Return

(bool) true if string is binary, false otherwise.


Source

File: wp-admin/includes/class-wp-filesystem-base.php

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

Changelog

Changelog
Version Description
WP-2.7.0 Introduced.