Subtraction of Date in angularjs

I want to subtract two dates in angularjs which are getting fetched from database. The code works fine for all values except subtraction between dates fetching from database...I used PHP with MySQL can anyone tell me how to do this subtraction. Here ...
more »

2017-12-03 19:12 (1) Answers

Equivalent $request->path() in pure php

Assume this url: http://localhost/myproject/public/add/11 The result of this code: echo $request->path() is add/11. Now I want to know how can I get that value in pure php? Because I need to use that value in a view which isn't called by a c...
more »

2017-12-03 14:12 (3) Answers

How to change xml file with php

I search an example of code that can change my xml file thanks to PhP but I don't find on the Internet. I try to change my tag score1 and score2. This is (example) my xml code : <Coupe> <Groupe id = "Groupe A"> <Match id = "1">...
more »

2017-12-03 14:12 (1) Answers

combine array entries with every other entry

Sorry for the title as it looks like most of the other questions about combining arrays, but I don't know how to write it more specific. I need a PHP function, which combines the entries of one array (dynamic size from 1 to any) to strings in every ...
more »

2017-12-03 10:12 (3) Answers

Share Contact Via Twillion to iPhone

I am looking to create a script to send a contact from Twillio to my iPhone. The purpose is the contact I send from Twillio to phone should look exactly the way contact shared by iPhone. Can someone help me, PS: Is it doable ? ...
more »

2017-12-02 19:12 (1) Answers

try catch in php pdo, doing it right way

I am using php pdo with postgres. I am using core php, no mvc, no classes and objects. I have some doubts in my mind since i am new to development, :- Should i use try catch on every query execution. And if i use try catch then should i exit the ru...
more »

2017-12-02 11:12 (2) Answers

PHP built-in server serving only .php files

I created a dir named "test", and inside this dir, i created 3 files: 1.jpg, 2.html and 3.php. If i run php -S localhost:80 and try to visit localhost/3.php, it works. But if i visit 1.jpg or 1.html, or any file that is not a php, it gives me a 404 n...
more »

2017-12-02 00:12 (1) Answers

How to order/limit an inner join in MySQL?

I am bad at SQL. I need to get certain information out of my database. This information is a list of User ID's and their username under a single account. There are 3 tables involved. CUSTOMER customer_id CUSTOMER_RELATIONSHIP relationship_type...
more »

2017-12-01 22:12 (2) Answers

Can PHP mess up a redirect? Is this possible?

Scenario 1: <?php header('Location: accessdenied'); //code to delete your entire database below ?> Scenario 2: <?php header('Location: accessdenied'); die(); //code to delete your entire database below ?> Hypothetically I was wonder...
more »

2017-12-01 16:12 (3) Answers

Laravel passport gives 401 Unauthenticated error

I'm using laravel passport for API authentication, it works perfectly when I use it with one db, but gives 401 when using multiple database, What I'm doing: I have a multi-tenant db, master db have users,roles and all oauth tables. When I create ...
more »

2017-12-01 14:12 (1) Answers

- in xml tag simplexml

I have tags like this in my xml <sub-up ...>...</sub-up> and when I do this $xmlData = simplexml_load_string($decodeData); foreach ($xmlData->sub-up->result as $res) { print_r($res); } I'm getting an error: "Parse err...
more »

2017-12-01 14:12 (1) Answers

ZF3: Read out url parameter in PhpRenderer

I want to upgrade from ZF2 to ZF3 right now and has the following problem with using URL parameter in my PhpRenderer. In ZF2 I use the HelperPluginManager to get Application, then the MvcEvent and finally the routeMatch: $routeMatch = $this ->...
more »

2017-11-30 17:11 (2) Answers

Common SQL query in Zend-Framework

How i can use a sql-query code that i already have on Zend-Framework using Model and Controller? I'm tried of many ways and i can't solve this. This is a example of "common sql-query code" to test: "SELECT id_arquivos_retorno FROM sa_arquivos_retor...
more »

2017-11-30 14:11 (1) Answers

php script to uglify, minify, optimize HTML

is there a PHP script that you know of that can take an HTML file ( with all of its CSS, js references be it embedded or linked ) and compress it, uglify it with the goal of making GOOGLE happy as far as its pageSpeed basic rules? I've got a ton of...
more »

2017-11-30 05:11 (0) Answers