PHP replaces the function of the internal link of the article with the php keyword (including the function of blocking and restoring the original link)

Source: Internet
Author: User
PHP replaces the function of the internal link of the article with the php keyword (including the function of blocking and restoring the original link)

  1. /*

  2. * Replacing the article chain with PHP
  3. * By bbs.it-home.org
  4. */
  5. Function _ base64_encode ($ t, $ str ){
  6. Return $ t. "\" ". base64_encode ($ str )."\"";
  7. }
  8. Function _ base64_decode ($ t, $ str ){
  9. Return $ t. "\" ". base64_decode ($ str )."\"";
  10. }

  11. Function _ keylinks ($ txt, $ replacenum = '', $ link_mode = 1 ){

  12. /* Shield the original */
  13. $ Replace_a = "\ _ base64_encode ('ori _ a = ',' \ 0 ')";
  14. $ Replaceappsa = "\ stripslashes (base64_decode ('\ 1 '))";
  15. $ Search_a = "/.*? <\/A>/isxe ";
  16. $ Searchdomaina = "/ori_a = (\".*? \ ")/Isxe ";
  17. $ Txt = preg_replace ($ search_a, $ replace_a, $ txt );

  18. /* Block alt title src */

  19. $ Search = "/(alt \ s * = \ s * | title \ s * = \ s * | src \ s * = \ s *) # find ([\ "\ '])? (.*?) # Find single or double quote
  20. (? (2) \ 2 | \ s + ?) # If quote found, match up to next matching
  21. # Quote, otherwise match up to next space
  22. /Isxe ";
  23. $ Replace = "\ _ base64_encode ('\ 1', '\ 3 ')";
  24. $ Replace1 = "\ _ base64_decode ('\ 1',' \ 3 ')";
  25. $ Txt = preg_replace ($ search, $ replace, $ txt );
  26. Echo $ txt;
  27. Echo"
    Http://bbs.it-home.org/<br>


    ";
  28. /*
  29. $ Keywords = $ this-> data ['keyword'];
  30. If ($ keywords) $ keywords = strpos (',', $ keywords) = false? Explode ('', $ keywords): explode (',', $ keywords );
  31. If ($ link_mode &&! Empty ($ keywords )){
  32. Foreach ($ keywords as $ keyword ){
  33. $ Linkdatas [] = $ keyword;
  34. }
  35. } Else {
  36. $ Linkdatas = getcache ('keylink', 'commons ');
  37. }
  38. If ($ linkdatas ){
  39. $ Word = $ replacement = array ();
  40. Foreach ($ linkdatas as $ v ){
  41. If ($ link_mode & $ keywords ){
  42. $ Word1 [] = '/'. preg_quote ($ v ,'/').'/';
  43. $ Word2 [] = $ v;
  44. $ Replacement [] = ''. $ v .'';
  45. } Else {
  46. $ Word1 [] = '/'. preg_quote ($ v [0], '/'). '/';
  47. $ Word2 [] = $ v [0];
  48. $ Replacement [] = ''. $ v [0].'';
  49. }
  50. }
  51. If ($ replacenum! = ''){
  52. $ Txt = preg_replace ($ word1, $ replacement, $ txt, $ replacenum );
  53. } Else {
  54. $ Txt = str_replace ($ word2, $ replacement, $ txt );
  55. }
  56. }
  57. */
  58. /* Restore the original */
  59. $ Txt = preg_replace ($ search1_a, $ replace1_a, $ txt );
  60. /* Restore alt title src */
  61. $ Txt = preg_replace ($ search, $ replace1, $ txt );
  62. Echo $ txt;
  63. Return $ txt;
  64. }

  65. $ Con ="

     Excessive sex life hurts the prostate. A harmonious and happy sex life is a natural physiological need of men and women. it is one of the adhesives of husband and wife feelings and is an essential part of husband and wife life. But couples with this idea should pay attention to it. Because x love is not the longer the better, the harmony and happiness of husband and wife's sexual life cannot be determined by the length of sex xai. On the contrary, timeout also affects the health of couples and even causes various diseases.

  66. ";

  67. _ Keylinks ($ con );

  68. ?>

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.