PHP XML basit değişken sorun

0 Cevap php

I would like to change the 4c050652f0c3e ( of <testimonial id="xxx"> ) to a dynamic variable that it is sent through a form. My variable is $nodeid = $_POST['nodeid']; but i can not replace it right.

This is the code

foreach( $testimonials->xpath("testimonial[@id='4c050652f0c3e']") as $t ) {
  $t->$_POST['tagname'] = $_POST['newname'];
}

This is what I did but it is not right

foreach( $testimonials->xpath("testimonial[@id=$_POST['nodeid']]") as $t ) {
  $t->$_POST['tagname'] = $_POST['newname'];
}

Teşekkür ederiz!

0 Cevap