I would like to ask a question about php and html. at the very beginning, I am very confused about a reference question. Example: & lt; form & gt; & lt; table & gt; & lt; tr & gt; & lt; td & gt; a & lt;/td & gt; & lt; -------- & lt;/tr & gt; & lt;/table & g ask a question about php and html.
At the beginning, I was confused about a reference problem. Tutorial
Example:
How can I use PHP or html statements to obtain "a" in a cell that has been created "? Do you want to set the attribute name or how? Carefully seek advice.
------ Solution --------------------
PHP code
$ Str = <
(. *) <\/Td>/is ', $ str, $ arr); echo $ arr [1];
------ Solution --------------------
Discussion
At the beginning, I was confused about a reference problem. Tutorial
Example:
How can I use PHP or html statements to obtain "a" in a cell that has been created "? Do you want to set the attribute name or how? Carefully seek advice.
------ Solution --------------------
$ Str = <
According to what I learned, I understand this. First, your sentence is not complete.
There are three methods to assign values to the string content of php.
$ Str = 'string ';
Enclose the string content to be set with single quotes or double quotation marks
$ Str = "string ";
There is also a way to assign values to large strings, such as an article.
I used this way
$ Str = <
String
Tag;
After the = sign, <tells the interpreter that all strings between the tag and the tag are assigned to the target variable.
The tag is only a token that can be changed, but must be paired before and after. for example, if I change to Chinese
$ Str1 = <
<标记
Chen Weiming
Mark;
Or English
$ Str1 = <
<陈伟明
Aaa;
Yes, as long as the front and back are the same (but it seems that no symbol can be used, at least I tried to insert a-sign to the mark to form a-a, No)
If I access the tag content, I also transfer these object-oriented programming methods such as VB to learn PHP, I also hope that PHP can add HTML code and other objects to facilitate users to access these elements (but I don't think it works very well. I guess these are generally used for collecting information, it is difficult to predict how the tag structure will change when the target site publishes information. according to the object access logic, I think the element content should be accessed in a tree structure, like accessing the XML tag content, HTML changes frequently)