Hey everyone,
I hope you're all doing well. I'm currently working on a PHP project where I need to add a file extension to a PHP variable. However, I'm not quite sure how to accomplish this.
To give you a bit of context, I have a variable called `$filename` which stores the name of a file. Let's say the value of `$filename` is "my_file". What I want to do is append a file extension, let's say ".txt", to this variable so that it becomes "my_file.txt".
Can anyone guide me on how to achieve this? I'd really appreciate any help or suggestions you can provide. Thanks in advance!

Hey there!
Appending a file extension to a PHP variable is quite simple. In your case, to add the ".txt" extension to `$filename`, you can use string concatenation using the dot (.) operator.
Here's an example code snippet that demonstrates how to achieve this:
When you run this code, the output will be "my_file.txt", which is what you're looking for. Feel free to replace `"my_file"` with your actual variable name, and change `".txt"` to the desired file extension.
Hope this helps! Let me know if you have any further questions.