How to get "name" attribute of html tag using php getStr? -


i'm trying find way content of html attribute "name", using php getstr, can't work anyhow, have searched, couldn't find find may me.

<input id="9d6e793e-eed2-4095-860a-41ca7f89396b.subject" maxlength="50" name="9d6e793e-eed2-4095-860a-41ca7f89396b:subject" value="" tabindex="1" class="subject required field" type="text"/> 

i want value string:

9d6e793e-eed2-4095-860a-41ca7f89396b:subject

i can value of tag one:

<input type="hidden" name="message" value="1442814179635.oz1lxjnxvcmmj0qpv0wglx4roea="/> 

with code:

getstr($b,'name="message" value="','"'); 

but can't find way attribute name of first one?

this bit of code want:

    <?php          $b = '<input id="9d6e793e-eed2-4095-860a-41ca7f89396b.subject" maxlength="50" name="9d6e793e-eed2-4095-860a-41ca7f89396b:subject" value="" tabindex="1" class="subject required field" type="text"/>';          echo "\$b = $b\n";          $rest = substr(strstr($b,'name="'),6);          echo "\$rest = $rest\n";          $name = strstr($rest,'"',true);          echo "\$name = $name\n";      ?> 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -