Get page title form url I have an url like this: http://drupal.dev/en/news-events

It's not my current page url. How can I get the page title by using above url ?
From below code example you can get the page title as your requirement

 $path = \Drupal::service('path.alias_manager')-&gt;getPathByAlias('/news-events');
 if(preg_match('/node\/(\d+)/', $path, $matches)) {
  $node = \Drupal\node\Entity\Node::load($matches[1]);
 }
 echo $node-&gt;getTitle();


Hope this helps. :)