PHP Regular
Now, we're going to use the regular. 17
17
Simultaneous send instant SMS return results
That's what I wrote.
Preg_match ("/\ (. *) \<\/error\>/u ", $string, $state);
But the output:
Array
(
[0] = = -
[1] = 17
)
What's wrong, and I use it.
Simplexml_load_string parse This XML error, I want to use this function to take this node, but no, now only use the regular
table to help, thank you.
------Solution--------------------
1. Yes, it is.
You can use $state[1] to get the value of the error node.
2.simplexml_load_string () If there is an error. It is most likely the reason for the file BOM header or the encoding inconsistency.
------Solution--------------------
Your output is the correct
------solution--------------------
Your regular is not wrong, you take $state[1] on the line The front one ignores
You use simplexml_load_string error probably is the XML inside the newline character carriage return caused by replacing them all replace
PHP code
!--? $xml = '
17 /error>
Send instant text messages synchronously to return results
'; $obj =simplexml_load_string (Str_replace ("\ r", " \ n "," \ T ")," ', $xml) ";p Rint_r ($obj);
------Solution--------------------
$xml = simplexml_load_string ($s);
echo $xml->error;
If an error occurs because your encoding is not appropriate