Category : loops

Is it possible to echo the response of the curl inside a while loop, every after the curl process is done and not after the loops are done. example $chk1=0; while (strpos($g1, ‘<label for="username" class="sr-only">’)) { $g = curl_init(); curl_setopt($g, CURLOPT_COOKIEJAR, "".$d."/COOKIE/".$ii[‘cookie’].""); curl_setopt($g, CURLOPT_COOKIEFILE, "".$d."/COOKIE/".$ii[‘cookie’].""); curl_setopt($g, CURLOPT_URL, ‘https://xxxx.net/login/index.php’); curl_setopt($g, CURLOPT_HTTPGET, 1); curl_setopt($g, CURLOPT_RETURNTRANSFER, 1); curl_setopt($g, ..

Read more

I have 2 arrays, that look like this: $alertTypes = [‘outbid’, ‘subAllVendorComments’]; $channels = [‘outbiduseSms’, ‘outbiduseBrowser’, ‘subAllVendorCommentsuseEmail’, ‘subAllVendorCommentsuseWhatsApp’]; My aim is to combine them into one array that is structured like this: Array ( [outbid] => Array ( [0] => useSms, [1] => useBrowser ) [subAllVendorComments] => Array ( [0] => useEmail, [1] => useWhatsApp ..

Read more

i keep getting the error Undefined offset: 5 in C:xampphtdocslogbookphp-logbook-wk2ex12.php on line 21 <?php $topModules[0] = "Open Source Systems"; $topModules[1] = "Programming 1"; $topModules[2] = "Programming 2"; $topModules[3] = "Web Application Development"; $topModules[4] = "Software Engineering"; ?> <head> <title>Data In Table</title> </head> <body> <table border=1 align="center"> <tr><th>Index</th><th>Subject</th></tr> <?php for($count = 0;$count < 5; $count++); { ..

Read more

hope you can help me on this.. i have this simple code : foreach ($by_sellers as $seller_id => $info) { print_r($info); echo ‘AMOUNT : ‘ . $info[‘total’] .’; STORE : ‘. $info[‘name’]; } and the output is this : Array( [‘total’] => 100 [‘name’] => ‘Store Name’ ) AMOUNT : ; STORE : its really ..

Read more

i use code to make a WordPress theme options page and i need help to transform this code to php loop change $photo_1 and photo_1 auto to $photo_2 etc —- for x=number <?php // in main file function my_awesome_page_display() { if (isset($_POST[‘photo_1’])) { $photo_1 = $_POST[‘photo_1’]; update_option(‘photo_1’, $photo_1); } if (isset($_POST[‘link_1’])) { $link_1 = $_POST[‘link_1’]; ..

Read more

I was easily able to get the count of elements in the 2nd level of my array using the count($array) function. The structure of my array is as follows: $course_data[$teacher_id][] = array( ‘course_name’ => $course_name, ‘course_description’ => $course_description, ‘course_tutor’ => $user_id, ‘course_videos’ => array( array( // data is already stored in the variables from $_POST ..

Read more