Is there a PHP function for swapping the values of two variables?

前端 未结 19 966
终归单人心
终归单人心 2020-12-02 08:36

Say for instance I have ...

$var1 = \"ABC\"
$var2 = 123

and under certain conditions I want to sw

19条回答
  •  没有蜡笔的小新
    2020-12-02 08:56

    Yes I know there are lots of solutions available, but here is another one. You can use parse_str() function too. Reference W3Schools PHP parse_str() function.

    
    

    DEMO

提交回复
热议问题