Category "php"

How to separate letters and digits from a string in php

I have a string which is combination of letters and digits. For my application i have to separate a string with letters and digits: ex:If my string is "12jan"

PHP Form Not Inserting

i have a php form which should insert data into my database when a button is press. but its doing nothing, no errors and i dont know why. please help i have gon

How to add automatically collapse/expand in content wordpress (single.php)?

There are a lot of WordPress plugins for adding collapse/expand in WordPress content, such as Collapse-O-Matic. But is there a way to add automatically collap

How can I get data from PHP to Android TextView?

How can I get data from PHP to Android? can you help me?, how can I display result of PHP to android textview this is my PHP code I should use JSON on this...

php 7 php.ini upload_max_filesize not working

I have read many solutions on internet , but still cannot change upload_max_filesize value (upload_max_filesize always = 2M ) here is my loaded php.ini in phpi

Fatal error: Array callback has to contain indices 0 and 1

I am getting this error: Fatal error: Array callback has to contain indices 0 and 1 in C:\xampp\htdocs\phpprojects\plapp\worker.php on line 53 How can I s

How to get the total hour from starting time to end time in php

How can I get the total hour from start time to end time. $start_time = '11:00:00 PM'; // as of 07/08/2013 $end_time = '01:00:00 AM'; // as of 08/08/20

Performance of foreach, array_map with lambda and array_map with static function

What's the performance difference (if there is any) between these three approaches, both used to transform an array to another array? Using foreach Using array

How to break out of a foreach once a condition is met?

I have a situation where when dealing with an object I generally use a foreach to loop through it like this: foreach ($main_object as $key=>$small_object) {

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

I want add a custom Button "View Demo" next to "Add to Cart" button of WooCommerce based on Product Type, both on main shop page and single product page. I've

How to access a var with "-" in PHP [duplicate]

For first time I found this problem, see I've a array of objetcs and I access them as follow: $arrayOfObjects[$pos]->value; But my probl

enable Apache http Authorization header

I write an API with PHP ZF2 they use HTTP Authorization. I fetch all HTTP Headers with apache_request_headers() (also tested with ZF2's $this->getRequest()-&

How To Verify Access Token on Server

So I want to create a game, but I don't want to store user sensitive data on my server (due to new laws ... etc). So I thought cognito might work out well. I re

PHP - Store information with NO database

I am going to improve a web site in Apache and PHP which has a page with a table containing a list of files. My goal is to allow the user to set one of those fi

PHPExcel change bar color of column chart

I'm using PHPExcel library in order to make an summary excel with 4 column charts. I managed to do that, but now I want to change the color of the columns and I

send json parameters to webservices

I got a task to scrap data from a site. Here is the site http://www.centris.ca/en/for-sale What i need to do is to scrap all the properties details. Below you w

Invalid value in field "itemtype" in Google Search Console

I am using the Jupiter theme in Wordpress. I created a new blog post and when submitted the same in Google Search Console/webmaster, I got the following error b

Warning: sqlite_query() expects parameter 1 to be resource, string given

I've looked all over the place and cant find a solution that helps my case. I hope someone can help? I have this and receive Warning: sqlite_query() expects pa

PHPS source file - 403 Forbidden You don't have permission to access this resource

Hi I am trying to view a .PHPS source file on Ubuntu 20.04.3 Apache 2.4.41 PHP 7 server but when I view the .phps file in the browser I get this message - 403

PHP: How to quickly split a key=value file into associative array

When you send a PDT transaction ID back to paypal, you get back a list of transaction data. It has SUCCESS on the first line, and then a list of key=value pairs