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”, &…
dyld library not loaded – PHP, Laravel, Composer command line commands not working
I updated my PHP version to 7.2 via homebrew and now any laravel,php, and composer command brings this error. I’ve googled the error though no luck! What do I need to install? Why has this now became an error? libldap-2.4.2.dylib Answer I fixed it – I ran…. Then after words a similar error c…
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> …
CakePHP 3.6: Change submit button label
I tried to change the label of a Submit button with no luck: Form->button(__(‘Submit’), array(‘name’ => ‘Create’)) ?> How I can change it?
Replace placeholders in text by referencing a translation variable
I’m trying to remove eval from the following function. I tried with sprintf and ${} , but still cannot find a solution. Here the function: Answer So, yes, eval() is often detested as one of the highest order “evils” in php. In most cases, when a task lends itself to be solved by eval() or va…
PHP/SQL – querying relational DB for IDs but being able to query those IDs in seperate DB using ORDER BY
I have an ecommerce site where I have some products that can be in multiple categories. I therefore have a products table, a categories table, and a product_categories table. So what I do is query …
“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 …