Reputation: 7092
I build an array of URLs from the content of a textarea, than process it with simple php dom.
I get this error:
Warning: file_get_contents(http://www.example.com )
Obviously, there is a whitespace at the end of the URL (which is the last in the array and the last in the textarea)
I checked other questions on stackoverflow, but I still can not get rid of this whitespace and get my script to work, even though my textarea tag contains no whitespaces at all.
This is what my textarea looks like (no whitespace anywhere):
<textarea id="textarea" name="textarea" value=""></textarea><br><br>
The array is separated by \n
I even make sure to delete possible whitespaces using the del
key after the last entry in the textarea, but I keep getting the same error.
How can I fix this?
Upvotes: 0
Views: 115