What a problem
I'm new in php, and I faced a very trivial problem: how to get form's name in php?
What I've tried:
$name = $form['name'];
print_r($name); // echo stuff like SimpleXMLElement Object ( [@attributes] => Array ( [name] => feedback [description] =>...
Question:
How can I get only name of the form?
$name = $form->attributes()->name;Please read the documentation.$name = $_POST['name'];which is "one" way of doing it, assuming you're using a POST request. You can also use$_GETor$_REQUESTinstead of$_POSTyet I tend to think that Amal's answer is what's to be used. Try posting your full code so we can see exactly what you have. 2 lines of code is a bit vague.