-3

how to split this url ?

https://example.in?url=https://test.in/admin/qrcode.php?s=qr&d=sps_dev_chanel_3&sf=8&ms=r&md=0.8&format=text

i need string after url, like below

https://test.in/admin/qrcode.php?s=qr&d=sps_dev_chanel_3&sf=8&ms=r&md=0.8&format=text
Alexander van Oostenrijk
  • 4,644
  • 3
  • 23
  • 37
Chinnu
  • 61
  • 8
  • 3
    `parse_url()` will extract the URL parts. But your example is invalid, because the "url" parameter contains an URL which is not urlencoded (it is mandatory to encode special characters in parameters) – Honk der Hase Aug 20 '21 at 09:40

1 Answers1

0
<?php

$string = "https://example.in?url=https://test.in/admin/qrcode.php?s=qr&d=sps_dev_chanel_3&sf=8&ms=r&md=0.8&format=text";

echo $string;

$urls = explode("url=",$string,2); // explode with limit 2

var_dump($urls); 

echo $urls[1]; // this is your result

Preview

sukalogika
  • 603
  • 4
  • 11
  • 18