EDIT: as several others have pointed out, it's possible (and generally better) to get the list of filenames directly in php, without involving a shell script at all. But if you do need to use a shell script for some reason...
Since unix filenames can contain any character except for "/" and ASCII NUL (character #0) (and file paths can contain "/"), the standardish way to pass lists of filenames is with NUL delimiters. Getting a list of filenames from a command like ls that doesn't use a clean format like this is hard, so it's best to get the list by just using a raw wildcard (e.g. *) and letting bash itself get the list. The one slightly tricky thing in this part is that by default, if there are no matching files, the shell will just leave "*" there rather than producing an empty list, so you want bash's nullglob option enabled, and that's a bash-only feature (so run this with bash, not just sh!).
#! /bin/bash
cd /home/chb-pc/Desktop || exit
shopt -s nullglob # If there are no files, don't just print the "*"!
printf '%s\0' * # Print each filename followed by a NUL
There's another slightly tricky thing about capturing this in php: the list has a NUL after each filename, including the last one, but explode assumes the delimiters are between items. As a result, it'll wind up with an empty item at the end of the array, and you need to remove that with array_pop.
<?php
$output = explode("\x00", shell_exec('bash /home/chb-pc/Desktop/files.sh'));
array_pop($output);
foreach ($output as $files) {
echo $files . "<br>";
}
?>
readis the command to read fromstdin, why won't you just useglob()in PHP?