Igor Skoric
Igor Skoric

Reputation: 654

What does an '@' in a php file string mean?

I am having trouble googling this, so please bear with me.

I have a code example that is about uploading files and there is the assignment of a temporary file to an array like this:

 $postparam['file1'] = '@../res/example.pdf';

I would like to know what the effect of the @ character is. I know about error suppression with @ but i am confused about the use inside the string.

Thanks.

Upvotes: 0

Views: 49

Answers (1)

Igor Skoric
Igor Skoric

Reputation: 654

I found the answer: The example uses cURL and that is why the @ is required as a prefix to the filename.

@filename This will make curl load data from the given file (including any newlines), URL-encode that data and pass it on in the POST.

Source

Upvotes: 1

Related Questions