WP_Filesystem_Base::is_binary( string $text )

Determines if the string provided contains binary characters.

Parameters Parameters


(string) (Required) String to test against.

Top ↑

Return Return

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

Top ↑

Source 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)

Top ↑

Changelog Changelog

Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

Top ↑

You must log in before being able to contribute a note or feedback.