Try:
$url="http://blabla/blablabla/dut2a/news.php";
$tokens = explode("https://stackoverflow.com/", $url);
echo $tokens[sizeof($tokens)-2];
Assuming $tokens
has at least 2 elements.
More Related Contents:
- How can I get parameters from a URL string?
- Regex ignore URL already in HTML tags
- How to filter Browsers UserAgents with PHP? [duplicate]
- How to inject javascript code that uses php variables into php page
- Missing argument 1 for Lib?
- How to get the first key of many duplicated json key? [duplicate]
- for loop is not executed /getting error like loop is not working
- AJAX request callback using jQuery
- Passing base64 encoded strings in URL
- How do I recursively delete a directory and its entire contents (files + sub dirs) in PHP? [duplicate]
- Simple PHP Post-Redirect-Get code example
- Copy entire contents of a directory to another using php
- including php file from another server with php
- Retrieving Multiple Result sets with stored procedure in php/mysqli
- CURL PHP send image
- PHP PDO – Num Rows
- jQuery AJAX form using mail() PHP script sends email, but POST data from HTML form is undefined
- Setting up Laravel on a Mac php artisan migrate error: No such file or directory [duplicate]
- Should my PHP functions accept an array of arguments or should I explicitly request arguments?
- PHP number format
- Warning: require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0
- Using WGET to run a cronjob PHP
- example of how to use fastcgi_finish_request()
- access denied for user @ ‘localhost’ to database ” [closed]
- Laravel change input value
- Execute a PHP script from another PHP script
- Laravel 5 Clear Views Cache
- Run PHPUnit Tests in Certain Order
- How to send Notification to Android from php?
- Mysqli multiple row insert, simple multi insert query [duplicate]