I have a PHP script that works with a large array of files. The array is serialized and stored in text format like:

```
E:\folder1\folder2\file2.txt|E:\folder1\folder2\file3.txt|E:\folder1\folder3\file1.txt|E:\folder1\folder4\file1.txt|E:\folder1\folder2\file5.txt etc... 

```

Using the "|" as split character upon reading the array back from file like: `$array = explode("|",$filesText);`

Given that a large number of the files have identical or similar paths, I would like to compress the string to cut down on file size when stored on disk. How can I compress/decompress the string, and what would be the most efficient way to do it? (smallest file size when stored, and fastest compression/decompression time.)