Saturday 15 September 2012

php - How to get data between tags of input field at last -


This is the following field that I want to get the input field names: -

  *** & lt; Input type = "text" class = "boxfieldcontent" maxlength = "10" value = "mobile number of 10 digit" onblur = "javascript: filledHTML ('mkhGzaCcqx', ​​'10 digit mobile number');" Onfocus = "javascript: FillValueOnFocus ('mkhGzaCcqx', ​​'10 digit mobile number ');" Name = "mkhGzaCcqx" id = "mkhGzaCcqx" style = "display: none;" & Gt; ***   

How is this possible? Exaggerate preg_match with an example, also tell the full details.

I just want to get the ID or name of the input field above.

should use the ID

  preg_match ('/ / Lt; input. * Id = "([^" ++] "/ ', $ str, $ match);   

Where $ str string is html containing < P> For the name you should use

  preg_match ('/ & lt; input. * Name = "([^"] +?) "/', $ Str, $ match ); In the   

$ match [1] will be the input id or name

Primary Match requires at least 2 parameters, we 3 will use.

  • Input String
  • An array of matches that return results. You can find more

  • No comments:

    Post a Comment