The GeneralUtility class in the TYPO3 CMS Core package provides various utility methods to simplify common tasks in PHP development. One such method is explodeUrl2Array, which is used to split a URL string into an array of its component parts.
In this example, the URL string is split into its scheme (https), host (www.example.com), path (/path/to/page), and query parameters (param1=value1¶m2=value2).
Example 2:
$url = '/path/to/missing/page';
$parts = GeneralUtility::explodeUrl2Array($url);
print_r($parts);
Output: Array ( [path] => /path/to/missing/page )
In this example, the URL string only contains a path, and no scheme or host. The resulting array only contains the path component.
The GeneralUtility class is part of the TYPO3 CMS Core package library.
PHP TYPO3\CMS\Core\Utility GeneralUtility::explodeUrl2Array - 30 examples found. These are the top rated real world PHP examples of TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array extracted from open source projects. You can rate examples to help us improve the quality of examples.