Yêu cầuTôi Đã Tạo Ra Quả Code Siêu TO KHỔNG LỒ Khiến Mọi Người Phải Trầm Cảm

14.07.2021 / 10:18
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

Chầm cảm thặc xự :v

24.07.2021 / 21:32
hoangchan
Bài đăng: 109
Member
Samsung j2
PHP
  1. <?php define('_IN_JOHNCMS', 1); $headmod = 'loto'; require('../system/bootstrap.php'); $textl = _t('SONG THỦ LÔ NUÔI KHUNG 3 NGÀY');
  2. require('../system/head.php');
  3. // Lấy source HTML dưới dạng chuỗi
  4. $source = $soc->html->get_source('https://http://ketqua1.net/xo-so-mien-bac', 1);
  5. if($source){ // Nếu get được dữ liệu
  6. // Chuyển từ chuỗi sang dạng DOM
  7. $dom = $soc->html->to_dom($source);
  8. if($dom){ // Chuyển sang DOM thành công
  9.  
  10. // Lấy ra thẻ img đầu tiên và in ra src
  11. $first_img = $dom->find('img', 0);
  12. if($first_img){
  13. echo $first_img->src;
  14. }
  15.  
  16. // Lấy ra tất cả thẻ a và in ra href
  17. foreach($dom->find('a') as $a){
  18. echo $a->href;
  19. }
  20.  
  21. // Bỏ script, style trong $source
  22. foreach($dom->find('script,style') as $script){
  23. $script->outertext = '';
  24. }
  25.  
  26. // Chỉnh lại nội dung bên trong thẻ p thứ 2 thành abc
  27. $second_p = $dom->find('p', 1);
  28. if($second_p){
  29. $second_p->innertext = 'abc';
  30. }
  31.  
  32. // In ra text bên trong div có class="xyz" đầu tiên
  33. $div_xyz = $dom->find('div.xyz', 0);
  34. if($div_xyz){
  35. echo $div_xyz->plaintext;
  36. }
  37.  
  38. // In ra tất cả thẻ a bên trong id="tn"
  39. foreach($dom->find('#tn a') as $a){
  40. echo $a; // hoặc echo $a->outertext;
  41. }
  42.  
  43. // In ra tất cả thẻ a có rel="nofollow"
  44. foreach($dom->find('a[rel="nofollow"]') as $a){
  45. echo $a; // hoặc echo $a->outertext;
  46. }
  47.  
  48. // Ẩn mọi thẻ pre và thêm alt cho tất cả thẻ img
  49. foreach($dom->find('pre,img') as $x){
  50. if($x->tag=='pre'){
  51. $x->outertext = '<div style="display:none">'.$x->outertext.'</div>';
  52. }else{
  53. $x->alt = 'Chú tích cho ảnh';
  54. }
  55. }
  56.  
  57. // Tìm ra div con đầu tiên bên trong div class="social"
  58. $first_social = $dom->find('.social', 0);
  59. if($first_social){
  60. $first_social->first_child(); // Tìm cha con anh em: parent / children / first_child / last_child / next_sibling / prev_sibling
  61. }
  62.  
  63. }
  64. }
  65.  
  66.  
  67. ?> <?php require('../system/end.php');
01.08.2021 / 18:31
hoangchan
Bài đăng: 109
Member
Samsung j2

Sau một thời gian vắng mặt, tôi đã trở lại với công việc của mình: else if

PHP
  1. $('#Maincauduoi_btnCreate1').on('click',() => {
  2. var text = Number($('#Maincauduoi_txtDan').val());
  3. if(text == '01') { text = '02 - 20';}
  4. else if (text == '10') {text = '02 - 20';}
  5. else if (text == '00') {text = '01 - 10';}
  6. else if (text == '55') {text = '01 - 10';}
  7. else if (text == '02') {text = '03 - 30';}
  8. else if (text == '20') {text = '03 - 30';}
  9. else if (text == '03') {text = '04 - 40';}
  10. else if (text == '30') {text = '04 - 40';}
  11. else if (text == '04') {text = '05 - 50';}
  12. else if (text == '40') {text = '05 - 50';}
  13. else if (text == '05') {text = '06 - 60';}
  14. else if (text == '50') {text = '06 - 60';}
  15. else if (text == '06') {text = '07 - 70';}
  16. else if (text == '60') {text = '07 - 70';}
  17. else if (text == '07') {text = '08 - 80';}
  18. else if (text == '70') {text = '08 - 80';}
  19. else if (text == '08') {text = '09 - 90';}
  20. else if (text == '80') {text = '09 - 90';}
  21. else if (text == '09') {text = '11 - 66';}
  22. else if (text == '90') {text = '11 - 66';}
  23. else if (text == '11') {text = '12 - 21';}
  24. else if (text == '66') {text = '12 - 21';}
  25. else if (text == '12') {text = '13 - 31';}
  26. else if (text == '21') {text = '13 - 31';}
  27. else if (text == '13') {text = '14 - 41';}
  28. else if (text == '31') {text = '14 - 41';}
  29. else if (text == '14') {text = '15 - 51';}
  30. else if (text == '41') {text = '15 - 51';}
  31. else if (text == '15') {text = '16 - 61';}
  32. else if (text == '51') {text = '16 - 61';}
  33. else if (text == '16') {text = '17 - 71';}
  34. else if (text == '61') {text = '17 - 71';}
  35. else if (text == '17') {text = '18 - 81';}
  36. else if (text == '71') {text = '18 - 81';}
  37. else if (text == '18') {text = '19 - 91';}
  38. else if (text == '81') {text = '19 - 91';}
  39. else if (text == '19') {text = '22 - 77';}
  40. else if (text == '91') {text = '22 - 77';}
  41. else if (text == '22') {text = '23 - 32';}
  42. else if (text == '77') {text = '23 - 32';}
  43. else if (text == '23') {text = '24 - 42';}
  44. else if (text == '32') {text = '24 - 42';}
  45. else if (text == '24') {text = '25 - 52';}
  46. else if (text == '42') {text = '25 - 52';}
  47. else if (text == '25') {text = '26 - 62';}
  48. else if (text == '52') {text = '26 - 62';}
  49. else if (text == '26') {text = '27 - 72';}
  50. else if (text == '62') {text = '27 - 72';}
  51. else if (text == '27') {text = '28 - 82';}
  52. else if (text == '72') {text = '28 - 82';}
  53. else if (text == '28') {text = '29 - 92';}
  54. else if (text == '82') {text = '29 - 92';}
  55. else if (text == '29') {text = '33 - 88';}
  56. else if (text == '92') {text = '33 - 88';}
  57. else if (text == '33') {text = '34 - 43';}
  58. else if (text == '88') {text = '34 - 43';}
  59. else if (text == '34') {text = '35 - 53';}
  60. else if (text == '43') {text = '35 - 53';}
  61. else if (text == '35') {text = '36 - 63';}
  62. else if (text == '53') {text = '36 - 63';}
  63. else if (text == '36') {text = '37 - 73';}
  64. else if (text == '63') {text = '37 - 73';}
  65. else if (text == '37') {text = '38 - 83';}
  66. else if (text == '73') {text = '38 - 83';}
  67. else if (text == '38') {text = '39 - 93';}
  68. else if (text == '83') {text = '39 - 93';}
  69. else if (text == '39') {text = '44 - 99';}
  70. else if (text == '93') {text = '44 - 99';}
  71. else if (text == '44') {text = '45 - 54';}
  72. else if (text == '99') {text = '45 - 54';}
  73. else if (text == '45') {text = '46 - 64';}
  74. else if (text == '54') {text = '46 - 64';}
  75. else if (text == '46') {text = '47 - 74';}
  76. else if (text == '64') {text = '47 - 74';}
  77. else if (text == '47') {text = '48 - 84';}
  78. else if (text == '74') {text = '48 - 84';}
  79. else if (text == '48') {text = '49 - 94';}
  80. else if (text == '84') {text = '49 - 94';}
  81. else if (text == '49') {text = '56 - 65';}
  82. else if (text == '94') {text = '56 - 65';}
  83. else if (text == '56') {text = '57 - 75';}
  84. else if (text == '65') {text = '57 - 75';}
  85. else if (text == '57') {text = '58 - 85';}
  86. else if (text == '75') {text = '58 - 85';}
  87. else if (text == '58') {text = '59 - 95';}
  88. else if (text == '85') {text = '59 - 95';}
  89. else if (text == '59') {text = '67 - 76';}
  90. else if (text == '95') {text = '67 - 76';}
  91. else if (text == '67') {text = '68 - 86';}
  92. else if (text == '76') {text = '68 - 86';}
  93. else if (text == '68') {text = '69 - 96';}
  94. else if (text == '86') {text = '69 - 96';}
  95. else if (text == '69') {text = '78 - 87';}
  96. else if (text == '96') {text = '78 - 87';}
  97. else if (text == '78') {text = '79 - 97';}
  98. else if (text == '87') {text = '79 - 97';}
  99. else if (text == '79') {text = '89 - 98';}
  100. else if (text == '97') {text = '89 - 98';}
  101. else if (text == '98') {text = '00 - 55';}
  102. else if (text == '89') {text = '00 - 55';}
  103.  
  104.  
  105. $('#Maincauduoi_txtDan1').val(text);
  106. })