Category "php"

Need to display only array value in JSON output

How to display only array value in JSON out in php I am using below PHP code echo '{"aaData":'.json_encode($user_details).'}'; And it return below output {

Session timeout in Yii2

I have used built in yii2 function to set session. I am not able to use built in yii2 login because of some requirement. So I have set session using below:

Wordpress check if is tag page

Is there a function like is_single for the tag page? something like is_tag?I need to do an if statement and something like this will be usefull. Thanks

Detect emoticons in string

I found that you need PHP 7 and MySQL 5.5 to use emoticons in a string that you want to upload to the database. I don't have these specification on my server s

How to create multiple sheet in Excel File PHP

I am trying to add two sheets in Excel file using my php code. Here is the code $objPHPExcel->setActiveSheetIndex(0); $objPHPExcel= $objReader->load(SS_AD

EXIF Title tag in PHP with with exif_read_data()

I have some struggles to get the "Title" tag from a JPG file with PHP. I guess I'm looking through the wrong EXIF group. I'm using following code: $exif = exif_

Curl+file scheme not returns headers in PHP 7.3+

Using this code: $ch = curl_init('file:///c:/foo/bar/baz.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_s

Doctrine 2 mapping referencing unique key

Basic question: Is it possible to map an association using Doctrine referencing not a primary but only a unique key? Extended Version: I have an Entity (Part

Getting output of MS stored procedure on php call

I am using the sqlsrv ms drivers for php, which work fine (tested with normal queries). I have also tested it with running a stored procedure to update a table

Is current location within radius of items stored in a table?

I have a table that stores longitude / latitude / radius ( miles ) per row. What I am trying to figure out is how to select ONLY the rows that my current point

PHP error: "The zip extension and unzip command are both missing, skipping."

When I run a composer update I get this error message: Loading composer repositories with package information Updating dependencies (including require-dev)

Virtuemart combine attributes to adjust the price

Is it possible to combine different attributes to calculate the price. Like, if I have to attributes, and when I have a attribute with 5 and a attribute with 4,

Combining a describing and one array with data

I'm looking for an easy way to combine two arrays. $lang = array('de' => 'german', 'es' => 'spanish', 'nl' => 'dutch'); I have X sites which should hav

How do I loop through an MS SQL database with VB.NET?

I'm trying to implement the following php code in visual basic. I wrote it in PHP because I knew I could do what I wanted to in that language, but I can't for t

Email sent through CakeEmail showing attachments icon in outlook even when no attachments is sent

I have using CakeEmail to send email but when I send Html and text email then the email show the attachment icon in the outlook . I found that it is because o

IDN (Domain) validation with regular expression

I want to check some domains with regular expression (regex). My old code was: /^([a-z0-9]+([-a-z0-9]*[a-z0-9]+)?.){0,}([a-z0-9]+([-a-z0-9]*[a-z0-9]+)?){1,63}(

Laravel no logout option from menu after successfull login

Hope anyone else had the same issue and was able to solve this problem. I installed a fresh Laravel project and used php artisan make:auth to get the basic auth

IonCube php encoder [duplicate]

i have a client that need some php changes, but is scripts are encoded by ioncube "//004ff // IONCUBE ENCODER 7.0 EVALUATION // THIS LICENSE M

Email sent through CakeEmail showing attachments icon in outlook even when no attachments is sent

I have using CakeEmail to send email but when I send Html and text email then the email show the attachment icon in the outlook . I found that it is because o

How to send image,audio or video through the WhatsApp API - PHP

I have Implemented an WhatsAPI - PHP on my site, but am only able to send messages but not the Media files like Images, Audio or Video. I got the WhatsAp