Selected from Linux Selected from PHP
- Ubuntu 17.10 Install google's mod pagespeed for apache - PHP-Ubuntu-Youtube-dl simple script for converting and downloading youtube video or mp3
- Ubuntu SSH tunnel via proxy - PHP while loop with every row with a different color
- Install GoAccess Apache Log Analyzer Tool on Ubuntu 17.10 - PHP use while loop in function
- SSHFS and map folder with a proxy - PHP List Files And Folders As links
- How to connect to SSH server with a proxy - PHP Extract Text From String
➥ PHP use while loop in function
Added by sonik on 29-05-2017 and keywords: php, while, loop, function, use, echo, return [ Print Article ]
There are two got ways:

<?php
   $html = null; // за чисто улеснение да кажем, че не е празен вар
   while($row = mysqli_fetch_assoc($unikalniipzaden)){
       $result = 'На: ' . $row['date'] . ' Е имало ' .$row['count'] . ' уникални посещения , ';
       $html .= $result; // точка и равно играе роля на добави след а=1 б=2 става 1 2
   }
   return $html;
?>


The first is more simple than the second.

function getNews(){
   //query stuff
   $result = array();
   while($row = mysql_fetch_array($result)){
        $result[] = "looped data";
   }
   return $result;
}

echo implode("<br>\n", getNews());

@All rights reserved with Copyright Webleit.info 2018 by Sonik_Blast [ Site Map ] [ RSS ] [ YouTube Mp3 Downloader and converter ]