PHP | DOMText isElementContentWhitespace() Function
The DOMText::isElementContentWhitespace() function is an inbuilt function in PHP which is used to check whether this text node contains whitespace in element content or not.
Syntax:
bool DOMText::isElementContentWhitespace( void )
Parameters: This function doesn’t accept any parameters.
Return Value: This function returns TRUE on success or FALSE on failure.
Below given programs illustrate the DOMText::isElementContentWhitespace() function in PHP:
Program 1:
<?php
$text = new DOMText( 'No_Space' );
if (! $text ->isElementContentWhitespace()) {
echo 'No ! Whitespace is not there.' ;
}
?>
|
Output:
No ! Whitespace is not there.
Program 2:
<?php
$text = new DOMText( 'Yes Space' );
if ( $text ->isElementContentWhitespace()) {
echo 'Yes ! Whitespace is there.' ;
}
?>
|
Output:
Yes ! Whitespace is there.
Reference: https://www.php.net/manual/en/domtext.iselementcontentwhitespace.php
Last Updated :
13 Mar, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...