Lumen: How to access api from zend framework?

Suppose there is an API developed by Lumen and a legacy code based in Zend framework. Assuming both code bases reside in the same server, how can I make api calls from Zend to Lumen. I hope to find a way like: // Zend receives request, it does what ...
more »

2017-04-20 23:04 (1) Answers

isset fatal error in 5.6 but fine in 7

This snippet of code causes a PHP fatal error in 5.6, but works fine in 7.0 and above. There is no documented change to isset that I could find stating that it works with arrays as constants. <?php class Test { const A = [1]; } echo isset(Te...
more »

2017-04-20 14:04 (0) Answers

UPS Shipping Tutorial (PHP)

I finally managed to set up an UPS shipment XML request and I would like to share it with other people struggling with it. So here is a complete PHP object oriented valid XML according to newest documentation from 2017. Im doing this because ther...
more »

2017-04-20 10:04 (1) Answers

how to explode a url string?

code: <?php include('conn.php'); $student_id = $_SESSION['student_id']; $college_name = $_GET['college_name']; $college_name22 = explode('(', $college_name); if(preg_match('#\((.*?)\)#', $college_name, $match)) { $...
more »

2017-04-20 07:04 (1) Answers

Storing Dynamic Data & Data Types in MySQL

I am building a data storage and visualization system using the traditional LAMP stack. The users need to be able to define the data types(string, int, decimal, boolean) and restrictions (length, decimal places, auto increment, etc) for the data ro...
more »

2017-04-19 19:04 (1) Answers

Lucene match in one of two fields

So I have the following indexed data in Lucene Title: FULL STACK GURU ONLY Description: test Now If I do the following query +title:We need a full stack guru+description:test It doesn't return anything, but If I do the following it works ...
more »

2017-04-19 13:04 (0) Answers

query and subquery join in laravel

i m trying this on laravel but i m getting error like this SQLSTATE[42601]: Syntax error: 7 ERROR: subquery in FROM must have an alias LINE 3: (select * from subcategory a inner join s... HINT: For example, FROM (SELECT ...) [AS] foo. (SQL: selec...
more »

2017-04-19 10:04 (2) Answers

Xdebug with VS Code on ubuntu not working

I am trying to debug php using xdebug on ubuntu 16.04 with Visual Studio code. I installed xdebug as per the instructions from the following site-Xdebug wizard. In the xampp the php version is shown as PHP Version 5.5.6 but when i run the command php...
more »

2017-04-19 08:04 (0) Answers

Optional parameter for Laravel routing

I want to make a route for these two URLs: http://localhost/myweb/public/compare http://localhost/myweb/public/compare/fb Here is the rout I've written: Route::get('compare/{fb?}', 'compareController@index'); It doesn't work as expected. Becaus...
more »

2017-04-19 07:04 (1) Answers

Get Alpha from PNG created with imagepng()

I try to get the alpha of a PNG when i have make this with imagepng(). My issue is alpha return only 0. My code for make PNG with alpha $x = 1; $y = 1; $gd = imagecreatetruecolor($x, $y); imagesetpixel($gd, 0,0, imagecolorallocatealpha($gd, 200,2...
more »

2017-04-18 15:04 (2) Answers

Laravel - Manipulate data from model

I may be over complicating this or missing something very simple so forgive me if I am. I am trying to manipulate/map some data in my model. A very simple example of what I am trying to do: I have $model->attr, this will return whatever is in m...
more »

2017-04-18 12:04 (2) Answers

PHP stream socket not working with HTML5 socket?

It seems that most HTML5 web socket example online with PHP are using the socket plugin. Is it possible to use stream_socket_server with HTML5 web socket? If yes, I am trying to build a simple socket server + client with PHP stream_socket_server fun...
more »

2017-04-18 10:04 (1) Answers

Zend framework error in magento 2

I am developing ecommerce website in magento 2. I got error when I am adding products from home page: Zend\Uri\Exception\InvalidUriException: URI is not valid and cannot be converted into a string in /var/www/html/voylite/vendor/zendframework...
more »

2017-04-18 10:04 (1) Answers

Laravel 5 Eloquent Model Results

I am using eloquent model to retrieve data from database.My query $tests_details = Previous_Mocks::where($data)->orderBy('sno', 'desc')->get(); As of my knowledge $tests_details will return array of objects(results) but when i echo is_array(...
more »

2017-04-18 09:04 (1) Answers

Convert PHP Array to JSON Array of object

I'm using Google Orgchart in my project. In that I'm returning JSON OBJECT from PHP file. Problem My Problem is when I hardcode the value, It works fine. When I return data from PHP file. It did not work. I guess the data format which is returning ...
more »

2017-04-18 08:04 (3) Answers