I got a text file [list_of_files.txt] contaning list of files without extension e.g.
image_23.
image_24.
image_25.
I'm using POST method to add a single word to all of the lines e.g "jpg" and display the results:
image_23.jpg
image_24.jpg
image_25.jpg
The problem is that echo displays:
image_23. jpg
image_24. jpg
image_25. jpg
How i can remove spaces?
$files=file('list_of_files.txt');
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
foreach($files as $list)
{
$extension = $_POST['extension'];
echo "$list",$exstension,"";
echo "</div>";
}
}else{
?>
trim($exstension)echo "$list"is a pointless use of quotes.echo $listworks just as well.echo "$list",$extension,"";and notexstensiontrim($extension);-)