I would like to host az FTP server on: mywebsite.domain/ftpserver.php The XAMPP server runs on my computer. The php is important, because I would like to authenticate the users using their passwords in the mysql database, and their directory’s name is also stored in the database. Or if there is a free f…
Tag: php
Regex validation matching pattern1 and pattern2 in PHP
I need to match a string against two patterns both patterns must match the string. You could imagine it as some sort of validation chain. Patterns in below code are just examples. I know code below is a possible solution, but I’m interested to know can it be done with one preg_match by joining patterns …
How to remove any special character from php array?
How to remove any special character from php array? I have array like: $temp = array (“.com”,”.in”,”.au”,”.cz”); I want result as: $temp = array (“com”,”in”,”au”,”cz”); I got result by this way: …
PHP: How to split array into 2 parts?
I have an array full of DB records. It could heaps of elements or very little, it changes regularly. I need to split the array into two equal parts. The reason is I am then passing these arrays to a Laravel view and displaying them into separate columns. Here is the DB records being pulled: $books = Book::whe…
Get Gmail All folder IMAP PHP
I want to access the All folder in gmail via imap. in different language and in different name. What should i do? The code of connection is: Answer This is the solution i found for the problem.The idea is that the All folder contains the biggest number of mails so we have to get the number of mails in all
Mockery: how does a passive partial mock differ from the default mock?
In the very last paragraphs of this (great) quick reference to Mockery, the author explains some behaviour modifiers for a mock which are not default, but may be useful. These include the makePartial() call and the shouldDeferMissing() call. How do these differ from the default behaviour? When you create a mo…
How to use Poedit with smarty templates?
I’m using PoEdit on smarty templates (phtml and tpl files) with the following Poedit configuration for PHP parser : Extensions: Parser command : If i’m using gettext inside PHP tags <?php _(‘test’); ?> Poedit detect that translation as expected. But i’m using Smarty {_(R…
Website Scraping from DoMDocument using php
I have a php code that could extract the categories and display them. However, I still can’t extract the numbers that goes along with it too(without the bracket). Need to be separated between the categories and number(not extract together). Maybe do another for loop using Regex, etc… This is the c…
Calculate the SUM of Fields in a dynamically changing form
I am currently trying to calculate the total sum of a dynamically changing form. What I currently have is a Symfony2 collection of forms, in which I Multiply a product amount by a unitcost = …
Redirect route with two parameters in WITH [Laravel]
I have problem to pass two varialbles with “with” in Redirect::route… Here is my code… How to do this Here is error: Undefined variable: cartItems (View: C:xampphtdocslaravel-webshoplaravelappviewscart-success.blade.php) CONTROLLER View Answer You may try this: Or this: