May I ask a question about php and html?

Source: Internet
Author: User
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.