Shokha
#81
mr_nokia02, php.ini dan yoqsez boladi! error_reporting degan narsani yoqish kerek! php kodi ham bor edi faqat osha sahifadagi xatolarni korsatadigan
1
tahrirlandi ·

#82
Arey, {
shart togri bosa bu yerda qavslarni ichida nechta qator kod bosa hammasi ishliydi!

}


else {
shart notgori bolsa bu qavsini ichidai barcha kodla ishlidi qavsdan chiqib keyin tegidagi kodla ham ishlab ketvuradi
}
1
1135
End
#83
Shokha, # Shokha (27.12.2018 / 13:24)
Arey, {
shart togri bosa bu yerda qavslarni ichida nechta qator kod bosa hammasi ishliydi!

}

else {
shart notgori bolsa bu qavsini ichidai barcha kodla ishlidi qavsdan chiqib keyin tegidagi k

Bundan xabarim bor.
Buni nega menga aytyapsiz?
0
tahrirlandi ·
AZIK
#84
if (!empty($files[5][0]) || !empty($files[5][1]) || !empty($files[5][2])){

bu qanday vazifa bajaradi
17 daqiqa 5 soniyadan keyin yozdi:
switch case break shunaqa kodlar ham borku bular nima vazifa bajaradi
kimdir biladimi
0
Shokha
#85
AZIK, if else ni bir turi hisoblanadi u ham shartga tekshiradi
0
AZIK
#86
Shokha, switch case chi??
0
1135
End
#87
alilay, # alilay (23.12.2018 / 14:46)
Salom!!

Manda bitta savol bor edi. Yani, chatga yoki boshga bir bolimga text yozilganda osha textga @ mana shu balgi bilan user niki yozilganda osha user ga notif borshi kerak. Oshani qanday qilsa
Substr orqali
0
Shokha
#88
AZIK, man ham osha siz etkan narsani etvomman if else bilan deyarli bir xil faqat ozgina farq qiladi
1

#89
Arey, substr bu stringni kesish shekilli
0
1135
End
#90
Shokha, # Shokha (29.12.2018 / 13:49)
Arey, substr bu stringni kesish shekilli
Ha shunday.
0
AZIK
#91
Shokha, phpda qanday qullanilishiga misol berolmaysizmi
0
Shokha
#92
1
Kod · PHP41 qator
<?php

if ($i == 0) {

    echo "i equals 0";

} elseif ($i == 1) {

    echo "i equals 1";

} elseif ($i == 2) {

    echo "i equals 2";

}



switch ($i) {

    case 0:

        echo "i equals 0";

        break;

    case 1:

        echo "i equals 1";

        break;

    case 2:

        echo "i equals 2";

        break;

}

?>
Серёжа tomonidan tahrirlandi ·
33
Tayota
#93
Korenda turgan xolatda ma'lum bir papkadagi fayl nomini özgartirish kerak. Demak,
rename('papka/fayl.php', 'test.php');
yoki
rename('papka/fayl.php', 'papka/test.php');
ammo öxshamadi:-( xatoyim qayerda?
0
653
BIX
#94

1 daqiqa 17 soniyadan keyin yozdi:
DO'STLAR SHU JAVOBNI RANDOM QILIB SOZLASH QANDAY BO'LADI JAVOB UCHUN OLDINDAN KATTA RAHMAT
2 daqiqa 29 soniyadan keyin yozdi:
O'ZIM YOZMOQCHI EDIM O'XSHAMADI
0
Kod · PHP61 qator
while (true) {

    $updates = $MadelineProto->get_updates(['offset' =>'-1', 'limit' => 10, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout

    \danog\MadelineProto\Logger::log($updates);

    foreach ($updates as $update) {

        $offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id

        switch ($update['update']['_']) {

            case 'updateNewMessage':

                if (isset($update['update']['message']['out']) && $update['update']['message']['out']) {

                    continue;

                }

                $res = json_encode($update, JSON_PRETTY_PRINT);

                if ($res == '') {

                    $res = var_export($update, true);

                }

                $text=$update['update']['message']['message'];

                if(mb_stripos($text,'Salom','XAYRLI KUN','KIM BOR')!==false or mb_stripos($text,'salom')!==false){

                    try {

                        $MadelineProto->messages->sendMessage([

                            'peer' => $update['update']['message']['from_id'], 

                            'message' => "SALOM","ASSALOMU ALAYKUM","VA ALEYKUM ASSALOM QALAYSIZ O'ZI",

                            'reply_to_msg_id' => $update['update']['message']['id'],

                            'entities' => [['_' => 'messageEntityPre', 'offset' => 0, 'length' => strlen($res), 'language' => 'json']]]);

                    

                    } catch (\danog\MadelineProto\RPCErrorException $e) {

                    $MadelineProto->messages->sendMessage(['peer' => '@ZEHNLI_NO2_BOT', 'message' => $e->getCode().': '.$e->getMessage().PHP_EOL.$e->getTraceAsString()]);

                        

                    }

                }

        }

    }

}
Сирожиддин tomonidan tahrirlandi ·
1348
ceouz
#95
BIX, Javoblarni massivga kiritib random bilan chiqaring.
30 soniyadan keyin yozdi:
#savol php scriptlash tilimi yoki dasturlash?
0
Hanov_Dayko
#96
ceouz, dasturlash
0
653
BIX
#97
ceouz, NAMUNA KO'RSATSANGIZ ILTIMOS
0
Сирожиддин
#98
ATOYAT, # ATOYAT (11.01.2019 / 18:09)
Korenda turgan xolatda ma'lum bir papkadagi fayl nomini özgartirish kerak. Demak,
rename('papka/fayl.php', 'test.php');
yoki
rename('papka/fayl.php', 'papka/test.php');
ammo öxshamadi:-( xatoyim q
1
Kod · PHP5 qator
<?php

rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");

?>
1348
ceouz
#99
BIX, # BIX (31.01.2019 / 09:49)
ceouz, NAMUNA KO'RSATSANGIZ ILTIMOS



Bu yerda $send taxminiy javob bo'ladi
0
Kod · PHP3 qator
$texts = array('Sizgaham salom', 'Assalomu alykum','Salom kayfiyatingiz qalay', 'Salom alekum qalaysiz'); 

  $send = $texts[rand(0, count($texts) - 1)];
Uz_MasteR
#100
Salom
Phpda rasmga matn yozish metodi qanday?
Biror kishi biladimi?
0