Ask the PHP expert to help the younger brother to modify it and be fully functional. Thank you-php Tutorial

Source: Internet
Author: User
Ask the PHP experts to help me modify it and get it fully functional. Thank you for dividing the program into three functions 1. The page is displayed after 30 random selections. (No problem) 2. Query function (such as s2) (for example, enter a short word here. A large number of databases are displayed. I want to display only 30 entries here .) 3. Display a single page (such as s3) (you want to add 30 randomly selected items under the same root homepage .) PHPcode & lt ;? Phpset_time_limit (0); $ presc ask the PHP experts to help me modify it to be fully functional. Thank you.
The program has three functions.
1. The page is displayed after 30 random selections. (No problem)
2. Query function (such as s2) (for example, enter a short word here. A large number of databases are displayed. I want to display only 30 entries here .)
3. Display a single page (such as s3) (you want to add 30 randomly selected items under the same root homepage .)


PHP code
  
  "; $ Pf_l. =''; $ Pf_l. ='. $ detail [0].'
'; If (fmod ($ r_num, $ lan) + 1 = $ lan) $ pf_l. =""; $ R_num ++; break ;}}$ pf_l ='

Quick brain turns: Find '. $ preference.'. $ r_num. '.

'. $ Pf_l .'
 

';} Elseif ($ id> 0) {$ dreamdb = file ("date/njjzw. dat "); // read database $ count = count ($ dreamdb); // calculate the number of rows $ detail = explode (" \ t ", $ dreamdb [$ id-1]); $ pf ='

Encyclopedia of brain teasers/questions about brain teasers'; $ Pf. ='

Brainstorming: '. $ detail [0].'Http://www.vipcha.net/naojinjizhuanwan/Mjcx.html </SPAN>

Answer: '. $ detail [1].'

View answer

';} Else {$ dreamdb = file ("date/njjzw. dat "); // read database $ count = count ($ dreamdb); // calculate the number of rows $ pfl = rand (0, intval ($ count/30 )); for ($ I = $ pfl * 30; $ I <$ pfl * 30 + 30; $ I ++) {if ($ I >=$ count-1) break; $ detail = explode ("\ t", $ dreamdb [$ I]); if (fmod ($ r_num, $ lan) = 0) $ pf_l. =""; $ Pf_l. =''; $ Pf_l. ='. $ detail [0].'
'; If (fmod ($ r_num, $ lan) + 1 = $ lan) $ pf_l. =""; $ R_num ++;} $ pf_l ='

We recommend that you use your brains to make quick turns '. $ r_num .'

'. $ Pf_l .'
 

';}?> Brainstorming

0 & $ id <= $ count) {echo $ pf;} else {echo $ pf_l;}?>

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.