-3

Example:

/var/www/media/ Book 1 Chapter 1 - Video 1 Part 1

to become

/var/www/media/Book 1 Chapter 1 - Video 1 Part 1
John Conde
  • 217,595
  • 99
  • 455
  • 496

1 Answers1

0

So assuming that this spacing is a result of this concatenation:

"/var/www/media/" . $filepath

Then the issue is with the $filepath variable. You can fix it by simply using the PHP trim() function to remove whitespace before and after the string.

Before: " This is my string. "

After: "This is my string."

dandemo
  • 397
  • 1
  • 5