Trying to delete a directory and his hidden files in linux with php

PHP
From the command line when I use: rm -fr /path/dir/{*,.??*} I can delete all files in /path/dir including the hidden files, but when I try to make ...
1 year ago

php - add + 7 days to date format mm dd, YYYY

PHP
I have date of this format March 3, 2011 in database and I need to extend it with 7 days. I mean $date = $date + 7. Is there any build in function to ...
1 year ago

How to split text into Unicode words with Regular Expression in PHP

PHP
I have a web site module which collects some tweets from twitter and splits them as words to put into a database. However, as the tweets usually have ...
1 year ago

Sort array based on key => value pair

PHP
I am trying to sort an array based on the key=>value but I can't get this done. Here is the code I am working out: $arr = [ '183034' => 9, ...
1 year ago

Exceptions in PHP - Try/Catch or set_exception_handler?

PHP
I'm developing some lower end code in my system that uses multiple child classes of the php exception class. Essentially I have the exceptions broken...
1 year ago

How to generate and insert millions of random numbers in a database and then save it in Laravel?

PHP
I am currently working on a Laravel application and it has a feature where some certain users will login to generate unique, 12-digit PIN numbers. Us...
1 year ago

Displaying data in table format from mysql database with php loop

PHP
Need to display retrieved data from mysql table in table format, but not getting the right display i planned for. This is how i want it to look like T...
1 year ago

php max() function gives wrong result

PHP
I'm trying to find the max value of each row in a file using php. My input looks like this. 1x5x10 1x10x5 5x1x10 5x10x1 10x1x5 10x5x1 My code: &lt...
1 year ago

Set custom Content-Type in Joomla Framework

PHP
I am using the Joomla framework API to build a web application. Now I want to display some data from the database in JSON format and I have to change ...
1 year ago

Detect redirect from specific page

PHP
I need to execute a PHP script only is a user is redirected from another page that starts with specific name. For example: domain.com/abcXXXXXX I've ...
1 year ago

How do I send a request to get specific data from server using HttpUrlConection in android?

PHP
I am a fresher to android. There are lot of examples to get data from server using HttpClient, HttpPost. but unfortunately i couldn't find any option ...
1 year ago

Keeping page in one place while changing images or reloading page?

PHP
I've checked this site for the same kind of questions but I'm not looking to change the image on this project without the page reloading - it needs to...
1 year ago

Eloquent model 'with' call inside the controller

PHP
Let's say I have a Post model that hasMany Comment model. So basically to get the comments I would do $post->comments. On some websites, I have se...
1 year ago

php abstract class inheritance error with no abstract method to inherit

PHP
I'm a relative newbie to OOP, and I am getting this error on a learning exercise. Class contains 6 abstract methods and must therefore be declared ab...
1 year ago

Getting data from two coordinating foreach php

PHP
I have a foreach loop for fetching arrays of date and storing it in a table. I implemented it just fine. Until i included the data of each array of d...
1 year ago

PHPExcel generated excel file not working. (File format or extension is invalid )

PHP
PHPExcel generated excel file not working. (File format or extension is invalid ) The example code of PHPExcel exceutes successfully on my local PC ,...
1 year ago

PHP strtotime( YYYY-mm last day) a month off error

PHP
I'm trying the following command in PHP 5.2.12 : print (date('Y-m-d', strtotime('2009-12 last day'))); Regarding to the php.net manual : date('m/d...
1 year ago

ebay like API interface for a web portal

PHP
We have developed a B2B Web portal for Graphics Job Work which is similar to Camera Ready Art (www.camerareadyart.com). It is targeted for people want...
1 year ago

Getting count of array items in multi dimensional array

PHP
Ok I've been trying for days now to get somewhere with this so please could someone help me out with an answer that actually works? I've been pouring ...
1 year ago

Where is XAMPP's Shell?

PHP
I am using the latest version of XAMPP with XAMPP control panel v2.5 (9 May 2007). I want to access the command line to run php -q htdocs\path\to\file...
1 year ago