Skip to content

PHPDoc – typehint a variable to see static methods

I have this code: Is there any way how to typehint in PHPDoc, that variable “$sSomeClass” is a class name, so IDE can see a reference to that class? Answer Well… But I assume $sSomeClass is not a straight assignment like shown? In that case… possibly? IDE wouldn’t be able to dete…

Making Curl to PHP request json rpc

I am trying to connect to Electroneum wallet rpc. The example Curl request is:- Which works perfectly fine on machine side. But when I try PHP like this It returns { “error”: { “code”: -32601, “message”: “Method not found” }, “id”: “0”, &…

List and download clicked file from FTP

I have FTP and I need list all files in FTP in uploads directory and after click on any listed file it will download the specific file from FTP. It list my files in uploads directory but when I will try to download file so it types me “no file” My code: Answer Your link in the generated <a> …

“zip_read() expects parameter 1 to be resource, integer given”

When trying to execute the following snippet The script returns “zip_read() expects parameter 1 to be resource, integer given” Answer Solution: 1) Double check your path and file permissions 2) Make sure ZIP is valid (sometimes happens with 3rd party generated archives) 3) Echo out the integer ret…

PHPMailer & GoDaddy

My problem is simple: send an email with PHPMailer, i have followed the rules of godaddy: $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTP_AUTH = false; $mail->Port = 25; $mail->…

PHP Only allow specific words in a string [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question I’m trying to check if the given string contains words that are not …