Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can I detect which request type was used(GET, POST, PUT or DELETE) in php?

<p style="text-align:left;"><span>For more details please see the </span><a href="http://php.net/manual/en/reserved.variables.server.php">documentation for the $_SERVER variable</a><span>.</span></p>

user-image
Question added by Hany Hassan , مدير قسم تكنولوجيا المعلومات , العقاد للاعمال الهندسية
Date Posted: 2015/01/02
هاشم المشارقة
by هاشم المشارقة , Key Account Manager , Advanced United Systems Ltd. ( A member of Taj Holding Group)

 

I think you should use use the variable $_SERVER['REQUEST_METHOD']

Faisal Farooq
by Faisal Farooq , Network & Linux System Support Engineer , RED SIGNAL

$_SERVER variable will let you know that which type of request you are getting. e.g

By using $_SERVER['REQUEST_METHOD']

For further details please see the documentation of $_SERVER variable .

Deleted user
by Deleted user

$_SERVER['REQUEST_METHOD']

Mohamed Ghareeb
by Mohamed Ghareeb , Senior Full Stack Developer , Aymax

using $_SERVER['REQUEST_METHOD'] you can detect which type of request 

Khalid Dawood
by Khalid Dawood , Senior HR Planning & Development , FMCG Company

By using $_SERVER['REQUEST_METHOD'] For more details please see the documentation for the $_SERVER variable.

More Questions Like This