Base64 decode

Discussion in 'PHP' started by karkajoi, 1 Dec 2020.

  1. karkajoi

    karkajoi Well-Known Member

    Joined:
    26 Oct 2016
    Messages:
    426
    Likes Received:
    306
    Reputations:
    5
    Доброго времени суток.
    В пхп не силен, поэтому прошу помощи.
    Есть исходные строки

    Слово:base64(string)
    Слово:base64(string)
    Слово:base64(string)

    Надо сделать вывод

    base64(string):base64_decode(string)
    base64(string):base64_decode(string)
    base64(string):base64_decode(string)

    Либо

    Слово:base64(string):base64_decode(string)
    Слово:base64(string):base64_decode(string)
    Слово:base64(string):base64_decode(string)
     
  2. crlf

    crlf Green member

    Joined:
    18 Mar 2016
    Messages:
    623
    Likes Received:
    1,278
    Reputations:
    399
    PHP:
    $arr = ['test:MTEx','root:MjIy','toor:MzMz'];
    //$arr = file('file.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

    foreach($arr as $str)
       echo 
    $str.':'.base64_decode(trim(strstr($str':'),':')).PHP_EOL;
     
Loading...