Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Crawler.php

function Crawler::normalizeWhitespace

2 calls to Crawler::normalizeWhitespace()
Crawler::innerText in vendor/symfony/dom-crawler/Crawler.php
Returns only the inner text that is the direct descendent of the current node, excluding any child nodes.
Crawler::text in vendor/symfony/dom-crawler/Crawler.php
Returns the text of the first node of the list.

File

vendor/symfony/dom-crawler/Crawler.php, line 1233

Class

Crawler
Crawler eases navigation of a list of \DOMNode objects.

Namespace

Symfony\Component\DomCrawler

Code

private function normalizeWhitespace(string $string) : string {
    return trim(preg_replace("/(?:[ \n\r\t\f]{2,}+|[\n\r\t\f])/", ' ', $string), " \n\r\t\f");
}
RSS feed
Powered by Drupal