Category "php"

Convert date and time to Jalali in Laravel

I want to change the time and date calendar to Jalali (Shamsi calendar used in Iran) in my system. How can I do this? "language_title" => "English",

How to unlink image from folder?

I am currently working on shopping cart.let me quick expain whats happening in product_info.php page. in product info page products information in displayed su

How to hide products with price higher than 1 on WooCommerce shop and archives pages

I'm using this code to hide products on the Shop Page where the product price is higher than 1. However, without the desired result. Where does it go wrong? M

Laravel 5.5 change unauthenticated login redirect url

In Laravel < 5.5 I could change this file app/Exceptions/Handler to change the unauthenticated user redirect url: protected function unauthenticated($reques

Override default Auth routes in Laravel 7

I need to custom routes of Auth::routes();, I can not find them, try search in Router.php Vendor\laravel\framework\src\Illuminate\Routing\Router.php But I

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

I have been stuck with this error for quite some time now. Earlier I got this error on godaddy and asked it over here. Now I'm getting it on hostinger shared ho

What is PHP's equivalent of JavaScript's "array.every()"?

I'm currently trying to port some JavaScript over to PHP. However, I can't seem to find PHP's equivalent to the JavaScript array.every() function. I found PHP's

Pages are working fine on localhost but not running on the hosting server

I created a PHP website which is working fine on my localhost but when I uploaded the same code on the server, it is showing me blank pages on the server. Prob

How to add script to Leadpages?

I have found a UTM Tracking code script that I like to use on my own websites. I will try and explain how it works. A visitor lands on the website: The Link

Using PHP to connect to a remote MSSQL database

My local environment is WAMP. For a few pages i have to access a remotely hosted MSSQL DB, run queries and get back results. I have been supplied the following

Array to string conversion

$replacements = array( '{order_id}' => $order_id, '{site_url}' => $settings["site_url"], '{email}' => $user_email, '{last_name}' =&g

How to programmatically find public properties of a class from inside one of it's methods

I've got a class Foo with public and protected properties. Foo needs to have a non-static method, getPublicVars() that returns a list of all the public propert

PHP | "The requested PHP extension bcmath is missing from your system."

Greetings fellow developers, I am trying to use composer for a PHP project of mine on a development server I recently booted up and for some reason I am unable

MySQL order by field in Eloquent

When I want to define a custom sort order in a MySQL query I can do something like this: ORDER BY FIELD(language,'USD','EUR','JPN') What would be the Eloquen

After Login/Signup, Laravel returns "419 PAGE EXPIRED."

After migrating Laravel project Domain (.in to .institute) & Hosting (namecheap to name.com), everything works fine. But when I tried to Login or Signup, re

PHP's array_map including keys

Is there a way of doing something like this: $test_array = array("first_key" => "first_value", "second_key" => "second_value"); var

How to trim a video by 4 fragments to 4 seconds using the PHP-FFMpeg?

How to trim a video using the PHP-FFMpeg? I need to implement the following FFMpeg command: ffmpeg -i 7207783801bb.mp4 -filter_complex \ "[0:v]trim=start=10:en

how to get value from array in laravel

In laravel i get this type of array from where query. i want to get only those menu where parent is 0; $memus = Menu::where('parent', 0)->get()->toArra

Laravel eloquent update record without loading from database

I'm quite new to laravel and I'm trying to update a record from form's input. However I see that to update the record, first you need to fetch the record from d

Split comma separated value from table column into rows using mysql?

I found the post which has the column with 3 values seperated by commas. I will have more than 3 values seperated by commas . For example, ID CITY_ID ------