html - PHP Echo just one the item from the array, if reload do not echo

one text

Solution:

Make it an associative array, where the messages are the keys, and the values are boolean flags indicating whether the message has been shown. When a message is added to the array, the value is false. Then when the page is loaded, you only show these values, and set their values to true to prevent them being shown again.

foreach($_SESSION['arrayFolders'] as $message => &$flag){
    if (!$flag) {
        echo $message;
        $flag = true;
    }
}
unset ($flag); // remove the reference to the array element

Using the reference variable &$flag makes the assignment update the $_SESSION array.

Source