$page = ! empty( $_GET['page'] ) ? (int) $_GET['page'] : 1;
$total = count( $yourDataArray ); //total items in array
$limit = 20; //per page
$totalPages = ceil( $total/ $limit ); //calculate total pages
$page = max($page, 1); //get 1 page when $_GET['page'] <= 0
$page = min($page, $totalPages); //get last page when $_GET['page'] > $totalPages
$offset = ($page - 1) * $limit;
if( $offset < 0 ) $offset = 0;
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, playground")
package main
import (
"fmt"
)
func main() {
If you want to check if something is running at some port, you may run the following command::
Get-Process -Id (Get-NetTCPConnection -LocalPort 3306).OwningProcess
If an error is returned, then, there is nothing to run on the given port. Otherwise, it displays what the program/service is running.
OlderNewer