“string unik php” Kode Jawaban

string unik php

md5(uniqid(rand(), true))
Shadow

array php unik

<?php
    // Syntax: array_unique(array $array, int $flags = SORT_STRING): array
    // Desc: Removes duplicate values from an array
    $arr = Array("red", "red", "green", "blue", "blue", "white");
    echo "<pre>";
    print_r($arr);
    echo "</pre> <br><br>";
    
    $arrUnique = array_unique($arr);

    echo "<pre>";
    print_r($arrUnique);
    echo "</pre> <br><br>";

    /* -------- output -----------
    Array
    (
        [0] => red
        [1] => red
        [2] => green
        [3] => blue
        [4] => blue
        [5] => white
    )
    
    Array
    (
        [0] => red
        [2] => green
        [3] => blue
        [5] => white
    )
    */
?>

Jawaban yang mirip dengan “string unik php”

Pertanyaan yang mirip dengan “string unik php”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya