- preg_match: documentation ( source)
- print_r: documentation ( source)
<?php
$matches = array();
// $controller = $this->getRequest()->attributes->get('_controller');
$controller = "Acme\MyBundle\Controller\MyController::myAction";
preg_match('/(.*)\\MyBundle\\Controller\\(.*)Controller::(.*)Action/', $controller, $matches);
print_r($matches);