Hello people I have some problems with Zend Framework. I first got the following message: Message: Could not determine temp directory, please specify a cache_dir manually. I searched google and found this post: Zend Framework : Could not determine temp directory, please specify a cache_dir manually I read it …
Export CSV for Excel
I’m writing a CSV file in PHP using fputcsv($file, $data). It all works, however I can’t just open it in Excel but have to import it and specify the encoding and which delimiter to use (in a wizard). …
Turn off display errors using file “php.ini”
I am trying to turn off all errors on my website. I have followed different tutorials on how to do this, but I keep getting read and open error messages. Is there something I am missing? I have tried …
Why don’t large files download easily in Laravel?
My file (126 MB size, .exe) is giving me issues. I’m using the standard laravel download method. I tried increasing the memory but it still either says I have run out of memory, or I download a 0 KB size file. The documentation doesn’t mention anything about large file sizes. My code is Anything I…
What is better to use: in_array or array_unique?
I am in doubt what to use: foreach(){ // ….. if(!in_array($view, $this->_views[$condition])) array_push($this->_views[$condition], $view); // …. } OR foreach(){ /…
Is there any way to detect if a database table exists with Laravel
I want to be able to create a table using But before that I would like to check if the table already exists, perhaps something like However, the above function does not exist. What else can I use? Answer If you are using Laravel 4 or 5 then there is the hasTable() method, you can find it in the L4
How to know the match count in preg_replace_callback – PHP
I have this code in php -: When in function pregRepler, i would want to know the current match number like if it is the first match or the second or anything… How do i do it.?? Answer Try something like this: This works better with an anonymous function, as I mentioned in my answer to your other questio…
CakePHP how to set a message from Model?
I’m trying to send a specific message from Model in beforeSave() method. Flash messages don’t work. I could send this message from Controller and use some parameters but I don’t this this best …
file upload to a folder in wordpress
I have use the below written code for move the file to a folder named “training”. To save the image i wrote this But i could not get any result. Did i do any mistake. please help me. This is my entire code Answer You are doing it wrong. $upload_dir[‘baseurl’] gives the URL to the uploa…
how to align text in textarea in html
I have a textarea and I am also writing some PHP code to prefill the textarea upon refresh. The “prefill” part is working fine. My problem is when I start to type in the textarea, the text is not left aligned. It is starting at some random point in the textarea box. I want it left aligned like a n…