PacPac PacPac - 5 months ago 14
PHP Question

Get variables from string in PHP

I have this string:

module=rooms-edit&action=new


How can I, in PHP, get the
module
and
action
informations ?

Answer

You can use parse_str() -

<?php

$var = "module=rooms-edit&action=new";
parse_str($var);
echo $module."<br>";
echo $action;

Docs

Comments