PHP personal website set up a serial Talk (ii) _php tutorial

Source: Internet
Author: User
Tags html header
Three first page press release to make your update easier (ON)
--------each time in the first page to add a message, add two words, you have to upload the entire page, it is not worth! So like the blue wind this lazy like a once and for all, real dynamic real-time, remote management editing, automatic maintenance function. It can also be used as a bulletin board for Virtual communities. (If you change it, you can put your news center of the news on the homepage automatically generated a summary, hehe.) So many functions, everyone forgive, hey.
--------first to insert a few digression, when we do the site, is the HTML between the middle dot php, or PHP to generate HTML? Professional sites can be a feature in a single page, through the page call different modules to implement each sub-function (so that the client is not just one page?). I haven't tried it). In any case, functional modular software reuse is an important method of efficient development (and can also save your host space Oh ^_^).
--------All right, let's get down to the function of the modular bar. For beginners, read the code carefully, paying particular attention to the use of basic functions. Master can skip this paragraph, hehe (so seriously?) They all look embarrassed. 9-().
/*head.php in order to avoid being directly typed Head.inc download your source code, it is best to use PHP suffix, so that your server will intercept it for processing, hehe */
echo " <title>"<br>echo" network Management "//if the title is constant, you can do a function. <br>echo "</title>"
?>
This is a function block that writes the HTML header.
/*makestr.php defines a function that handles hyperlinks in the text, assuming that the link form in the text is the ${http://www.yoyonow.net| network management path}*/
function Makestr ($text)
{$str = $text;
$a =strstr ($s, ' $} ');//Remove the substring before ' ${' in $s
if ($a) {
$b =strstr ($a, '} ');
if ($b) {
$la =strlen ($a); $ls =strlen ($s);//Take string length
$s =substr ($a, 0, $ls-$la);//Take a substring, the second argument is the starting point, the third argument is the number of characters taken
$a =substr ($a, 2);//Remove ' ${'
$LB =strlen ($b); $la =strlen ($a);
$a =substr ($a, 0, $la-$lb);//Take out the Hyperlinks section
$b =substr ($b, 1);//Remove '} '
$ta =strstr ($a, "|"); /Find out if there is any text that needs to be linked
if ($ta) {
$la =strlen ($a); $lt = (strlen ($TA);
$linktext =substr ($a, $la-$lt + 1);
$a =substr ($a, 0, $la-$lt);
}
else{
$linktext = $a;
}
$s = $s. ". $linktext. ". $b;//Prepare to return a string
}
}
return ($s);
}

--------If you're a novice, you should look for a book with an introduction to HTML. Otherwise it is difficult to become a PHP master. These functions, which you begin to look very simple in handling strings, can do a lot of beautiful things through your clever use. Next, we can see that we have prepared the results of most of the day, hehe.


http://www.bkjia.com/PHPjc/316042.html www.bkjia.com true http://www.bkjia.com/PHPjc/316042.html techarticle three The first page press release, make you update more easily (on)--------each time in the first page to add a message, add two words, you have to upload the entire page, it is not worth! So like the blue wind this lazy man ...

  • Related Article

    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.