Most answered questions in PHP

0 votes
2 answers

How to use basic authorization in PHP curl?

If you are saying Basic authentication, then ...READ MORE

Jan 3, 2021 in PHP by Manas
• 140 points
32,574 views
0 votes
2 answers

How to catch curl errors in PHP?

For (PHP 4 >= 4.0.3, PHP 5, ...READ MORE

Nov 9, 2020 in PHP by anonymous
• 160 points
18,162 views
0 votes
2 answers

How to copy a file from one directory to another using PHP?

Simply, $source = 'Source_file_location' ...READ MORE

Oct 12, 2020 in PHP by anonymous
• 140 points
1,151 views
+1 vote
2 answers

How to make asynchronous HTTP requests in PHP?

Hello @kartik, Use this code: function post_without_wait($url, $params) { ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,880 points
2,329 views
0 votes
2 answers

Error:SMTP server response: 530 SMTP authentication is required.

Yes good i like it so nice ...READ MORE

Aug 25, 2020 in PHP by Mani Usman
3,601 views
0 votes
2 answers

Error:“Cannot Connect to Server - A network-related or instance-specific error”?

Hello, The "sql server error 40" is appears mostly ...READ MORE

Aug 18, 2020 in PHP by Fantazma
• 140 points
28,336 views
0 votes
2 answers

How to override trait function and call it from the overridden function?

instead of: return traitcalc($v); use this: ...READ MORE

Dec 13, 2020 in PHP by Uncle Nick
3,054 views
0 votes
2 answers

How can we create a session in PHP?

Hello, niroj. Here is my idea session_start(); $_SESSION['USERNAME'] ...READ MORE

Dec 7, 2020 in PHP by Famous
• 140 points
936 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

Aug 8, 2020 in PHP by anonymous
9,659 views
0 votes
1 answer

Using reactJS, php and mysql is possible?

I want to study ReactJS; is there ...READ MORE

Aug 5, 2022 in PHP by narikkadan
• 63,420 points
400 views
0 votes
1 answer

How do I strip all spaces out of a string in PHP?

If I have understood your question right, ...READ MORE

Feb 23, 2022 in PHP by Aditya
• 7,680 points
933 views
0 votes
1 answer

How do I convert a string to a number in PHP?

You don't have to do this, since ...READ MORE

Feb 23, 2022 in PHP by Aditya
• 7,680 points
413 views
0 votes
1 answer

Convert a PHP object to an associative array

Start with simply typecasting the line:- $array = ...READ MORE

Feb 23, 2022 in PHP by Aditya
• 7,680 points
1,689 views
0 votes
1 answer

CodeIgniter removing index.php from url

To solve your doubt, use the following ...READ MORE

Feb 23, 2022 in PHP by Aditya
• 7,680 points
930 views
0 votes
1 answer

PHP undefined key and variable

Hi, @Dann, If you are using some variable ...READ MORE

Dec 30, 2020 in PHP by anonymous
• 65,910 points
44,841 views
0 votes
1 answer

error display_errors = On

You can try this one: error_reporting(E_ALL); ini_set('display_err ...READ MORE

Dec 2, 2020 in PHP by Niroj
• 82,880 points
514 views
0 votes
1 answer

How do I resize pngs with transparency in PHP?

Hello @kartik, you need to set the blending ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,123 views
0 votes
1 answer

PHP __PHP_Incomplete_Class Object with my $_SESSION data

Hello @kartik, You just have to include the safestring.class.php before ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,156 views
0 votes
1 answer

How to embed images in html email?

Hello @kartik, PHPMailer has the ability to automatically ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
1,350 views
0 votes
1 answer

Fatal error: Call to undefined function mysql_connect()

Hello @kartik, You upgraded to PHP 7, and ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
3,068 views
0 votes
1 answer

How to pass multiple variables to another page in url?

Hello @kartik, Use the ampersand & to glue variables together: $url ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
20,991 views
0 votes
1 answer

How to get the http headers from current request in PHP?

Hello, Try this code: if (!function_exists('getallheaders')) { ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,417 views
0 votes
1 answer

How to check if row is soft-deleted in Eloquent?

Hello, Try this: if ($thing->trashed()) { ... } READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,623 views
0 votes
1 answer

How to drop softDeletes from a table in a migration?

Hello, On your migration class: public function down() { ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
1,318 views
0 votes
1 answer

Error:preg_match() [function.preg-match]: Unknown modifier '+' in raptr.php on line 14

Hello, Try this code: preg_match('/[a-zA-Z]+<\/a>.$/', $lastgame, $match); print_r($match); Using / as a delimiter ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
2,004 views
0 votes
1 answer

How to use a string path to set nested array data?

Hello @kartik, Use the reference operator to get ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
1,828 views
0 votes
1 answer

How to fix the session_register() deprecated issue?

Hello, Use $_SESSION directly to set variables. Like this: $_SESSION['name'] = 'stack'; Instead ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
718 views
0 votes
1 answer

How to pass an array via $_GET in php?

Hii, You can pass an associative array to http_build_query() and ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
3,923 views
0 votes
1 answer

How can I ping a server port with PHP?

Hello, Try this : echo exec('ping -n 1 -w ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
9,343 views
0 votes
1 answer

How do I make global helper functions in laravel?

Hello @kartik, Create a new file in your ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
1,192 views
0 votes
1 answer

How to route GET and POST for same pattern in Laravel?

Hello @kartik, You could try the following: Route::controller('login','AuthController'); Then in ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
2,700 views
0 votes
1 answer

How to render CSRF input in twig?

Hello @kartik, You can do it with {{ form_widget(formView._token) ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
877 views
0 votes
1 answer

How to pass arguments to an included file?

Hello @kartik, Include has the scope of the ...READ MORE

Nov 20, 2020 in PHP by Niroj
• 82,880 points
2,749 views
0 votes
1 answer

How to get input field value using PHP?

Hello, Use PHP's $_POST or $_GET superglobals to retrieve the value of ...READ MORE

Nov 20, 2020 in PHP by Niroj
• 82,880 points
67,591 views
0 votes
1 answer

How to extract URLs from text in PHP?

Hello, A simple example capturing anything starting with http:// and https:// could ...READ MORE

Nov 20, 2020 in PHP by Niroj
• 82,880 points
5,995 views
0 votes
1 answer

How do I access static member of a class?

Hello, If A is a class, you can access it ...READ MORE

Nov 20, 2020 in PHP by Niroj
• 82,880 points
340 views
0 votes
1 answer

Error:fetching http headers in SoapClient

Hello, This error is often seen when the default_socket_timeout value ...READ MORE

Nov 20, 2020 in PHP by Niroj
• 82,880 points
7,161 views
0 votes
1 answer

How to remove new lines and returns from php string?

Hello @kartik, You need to place the \n in double ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
13,252 views
0 votes
1 answer

Error:Trying to get property of non-object in C:\wamp\www\ni\pages\init.php..

Hello, Try mysql_fetch_object(). It returns an object, not an ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
4,463 views
0 votes
1 answer

How can I ping a server port with PHP?

Hello @kartik, Test different ports: $wait = 1; // ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
3,230 views
0 votes
1 answer

How to allow duplicate keys in php array?

Hello @kartik, You could have a single key ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
3,493 views
0 votes
1 answer

How do I remove http, https and slash from user input in php

Hello @kartik, Use: $url = preg_replace("(^https?://)", "", $url ); This ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
1,982 views
0 votes
1 answer

Fatal error: Call to undefined function ImageCreate() in /home/t1g01/phplot.php on line 248

Hello @kartik, Your server most like does not ...READ MORE

Nov 18, 2020 in PHP by Niroj
• 82,880 points
5,859 views
0 votes
1 answer

How to read a list of files from a folder using PHP?

Try this: $files = array_values(array_filter(scandir($path), function($file) use ($path) ...READ MORE

Nov 18, 2020 in PHP by Niroj
• 82,880 points
426 views
0 votes
1 answer

Php exec() not returning error message in output

Hello @kartik, You need to capture the stderr too. Redirecting stderr to stdout should do ...READ MORE

Nov 18, 2020 in PHP by Niroj
• 82,880 points
4,679 views
0 votes
1 answer

How can I get the session ID in Laravel?

Hii, Use: $session_id = Session::getId(); or $session_id = ses ...READ MORE

Nov 18, 2020 in PHP by Niroj
• 82,880 points
5,469 views
0 votes
1 answer

How to Execute php file from another php?

Hello @kartik, It's trying to run it as ...READ MORE

Nov 18, 2020 in PHP by Niroj
• 82,880 points
11,018 views
0 votes
1 answer

PHP Warning Permission denied (13) on session_start()

Hello @kartik, You don't appear to have write ...READ MORE

Nov 17, 2020 in PHP by Niroj
• 82,880 points
3,789 views
0 votes
1 answer

How can to make a query with LIKE and get all results with mysqli ?

Hello @kartik, Here's how you properly fetch the ...READ MORE

Nov 17, 2020 in PHP by Niroj
• 82,880 points
647 views
0 votes
1 answer

How to write CDATA using SimpleXmlElement?

Hello @kartik, Try this: class MySimpleXMLElement extends SimpleXMLElement{ ...READ MORE

Nov 17, 2020 in PHP by Niroj
• 82,880 points
4,392 views