Grab values from PHP string

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Grab values from PHP string



I have a variable in my PHP script called $url


$url



Here's an example of how I use it:


<?php
$url = '/test/?utm_source=test&utm_campaign=test2&utm_medium=test3";



I'd like to have a PHP snippet that grabs the valus of utm_source, utm_campaign & utm_medium. How do I achieve this?


utm_source


utm_campaign


utm_medium




1 Answer
1



I have a feeling that the function parse_str() is exactly what you are looking for. See https://secure.php.net/manual/en/function.parse-str.php


parse_str()






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

Executable numpy error

Trying to Print Gridster Items to PDF without overlapping contents

Hystrix command on request collapser fallback