In that case, if we specify the elements of the array using the for loop, where each element is written as setcookie("visit$i", $allSite[$i][1]); , after checking such a record using the entire array output via var_dump everything works successfully - the cookies are set correctly, but output the element using echo , as well as use it in any other place using the code echo $_COOKIE['visit$i']; in identical cycle does not work. What can you advise?

  • one
    try double quotes to put 'visit $ i'. if you print them in a loop, you need $ i, and you should put the usual number - paqstd
  • Check if there is a cookie in the browser and put all the code in a loop. - silantyev.daniil
  • four
    double quotes change - teran

0