bool_from_yn

Definition:
function bool_from_yn( $yn ) {}

Whether input is yes or no. Must be ‘y’ to be true.

Parameters

  • string $yn: Character string containing either ‘y’ or ‘n’

Return values

returns:True if yes, false on anything else

Source code

function bool_from_yn( $yn ) {

	return ( strtolower( $yn ) == 'y' );

}

569

No comments yet... Be the first to leave a reply!

Leave a comment