Trending questions in PHP

0 votes
1 answer

How to load return array from a PHP file?

Hii @kartik, When an included file returns something, ...READ MORE

Nov 10, 2020 in PHP by Niroj
• 82,880 points
2,758 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,148 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,109 views
0 votes
1 answer

How to run process with realtime output in PHP?

Hello @kartik, This worked for me: $cmd = "ping ...READ MORE

Oct 20, 2020 in PHP by Niroj
• 82,880 points
3,566 views
0 votes
1 answer

How to matching an IP to a CIDR mask in PHP 5?

Hello @kartik, If only using IPv4: use ip2long() to convert the ...READ MORE

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

How do I PHP-unserialize a jQuery-serialized form?

Hello @kartik, Provided that your server is receiving ...READ MORE

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

How to return an array from an AJAX call?

Hello, Php has a function for this, just ...READ MORE

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

How to get request string without GET arguments?

Hello @kartik, You can use $_SERVER['REQUEST_URI'] to get requested path. ...READ MORE

Nov 14, 2020 in PHP by Niroj
• 82,880 points
2,404 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
1,999 views
0 votes
1 answer

Error: Class'Illuminate\Foundation\Application' not found

Hii, Use the --no-scripts flag to prevent artisan from executing ...READ MORE

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

How to change php version in htaccess in server?

Hello, To switch to PHP 4.4: AddHandler application/x-httpd-php4 .php To ...READ MORE

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

How to pass an array within a query string?

Hello, Submitting multi-value form fields, i.e. submitting arrays ...READ MORE

Apr 8, 2020 in PHP by Niroj
• 82,880 points
11,791 views
0 votes
1 answer

How to enable mysqlnd for php?

Hello, The ./configure command is part of the compilation process ...READ MORE

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

How do I find out my MySQL URL, host, port and username?

Hello @kartik, If you're already logged into the ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
5,966 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,824 views
0 votes
1 answer

How to remove html special chars?

Hello, Either decode them using html_entity_decode or remove them using preg_replace: $Content ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
2,666 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,966 views
0 votes
1 answer

How to enable cURL in PHP / XAMPP?

Hello @kartik, Since you're using XAMPP, uncomment the ...READ MORE

Oct 1, 2020 in PHP by Niroj
• 82,880 points
4,007 views
0 votes
1 answer

How To Execute SSH Commands Via PHP

Use phpseclib, a pure PHP, SSH implementation. An example: <?php include('Net/SSH2.php'); $ssh ...READ MORE

Oct 30, 2020 in PHP by Niroj
• 82,880 points
2,663 views
0 votes
1 answer

How do you create a .gz file using PHP?

Hello @kartik, This code does the trick // Name ...READ MORE

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

How to embed a .png image into an html page?

Hello @kartik, Try this: div.image { width:100px; ...READ MORE

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

How can I get ID of the last updated row in MySQL?

Hello @kartik, Suppose, item_id is an integer identity column in items table ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
11,404 views
0 votes
1 answer

How to create virtual column using MySQL SELECT?

Hello, Something like: SELECT id, email, IF(active = 1, ...READ MORE

Oct 20, 2020 in PHP by Niroj
• 82,880 points
3,008 views
0 votes
1 answer

What is the use of the @ symbol in PHP?

Hello @kartik, The @ symbol is the error control operator ("silence" or "shut-up" ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
11,414 views
0 votes
1 answer

How to store IP in database using php?

Hello @kartik, Store the ip as a INT(11) UNSIGNED, ...READ MORE

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

What are the proper permissions for an upload folder with PHP/Apache?

Hello @kartik, You can create a new group ...READ MORE

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

How to enable curl in xampp?

Hello @kartik, You have to modify the php.ini ...READ MORE

Oct 29, 2020 in PHP by Niroj
• 82,880 points
2,459 views
0 votes
1 answer

How To Run PHP From Windows Command Line in WAMPServer

Hello @kartik, Try using batch file Open notepad type php -S ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
2,526 views
0 votes
1 answer

How to find Object ID in PHP?

Hello @kartik, Use spl_object_hash() for that. It returns an unique identifier ...READ MORE

Nov 16, 2020 in PHP by Niroj
• 82,880 points
1,662 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

How to properly URL encode a string in PHP?

Hello @kartik, For the URI query use urlencode/urldecode; for ...READ MORE

Oct 19, 2020 in PHP by Niroj
• 82,880 points
2,894 views
0 votes
1 answer

How to comment out HTML and PHP together?

Hello @kartik, Instead of using HTML comments (which have ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,880 points
3,415 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,315 views
0 votes
1 answer

How to add a line break within echo in PHP?

Hello @kartik, You have to use br when ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
2,389 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,188 views
0 votes
1 answer

How to get the list of specific files in a directory using php?

Hello @kartik, You'll be wanting to use glob() Example: $files = ...READ MORE

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

Error:Got a packet bigger than 'max_allowed_packet'bytes

Hello @kartik, max_allowed_packet is set in mysql config, not ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
4,663 views
0 votes
1 answer

Error:Undefined index: barangay in C:\xampp\htdocs\TextBlast\homepage\insert.php on line 22

Hello @ Regina, First checks whether a variable is ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,880 points
5,409 views
0 votes
1 answer

How can I get enum possible values in a MySQL database?

Hello @kartik, I have a codeigniter version for ...READ MORE

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

How to change the session timeout in PHP?

Hello @kartik, Put $_SESSION['login_time'] = time(); into the previous authentication ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,880 points
3,988 views
0 votes
1 answer

PHP Parse error: syntax error, unexpected T_IMPLEMENTS, expecting '{' in X on line Y

Hello @kartik, You are looking for the extends keyword: Interface IFoo ...READ MORE

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

Error: Field 'display_name' doesn't have a default value

Hello @kartik, MySQL is most likely in STRICT ...READ MORE

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

Error:authentication parameter in the request are missing or invalid

Hello, Try the following code : $username='ABC'; $password='XYZ'; $URL='<URL>'; $ch = curl_init(); curl_setopt($ch, ...READ MORE

Nov 5, 2020 in PHP by Niroj
• 82,880 points
1,730 views
0 votes
0 answers

How do I connect to PostgreSQL without specifying a database name?

I need to connect to some PostgreSQL ...READ MORE

Nov 16, 2020 in PHP by kartik
• 37,510 points
1,275 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
503 views
0 votes
1 answer

How to get file_get_contents() to work with HTTPS?

Hello @kartik, Try the following script to see ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
4,479 views
0 votes
1 answer

How to override the path of PHP to use the MAMP path?

Hello @kartik, In your home folder /Users/David for exmaple, you ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
1,726 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
870 views
0 votes
1 answer

mysql error 'TYPE=MyISAM'

Hello @kartik, Replace TYPE=MyISAM with ENGINE=MyISAM The problem was "TYPE=MyISAM" which should ...READ MORE

Nov 17, 2020 in PHP by Niroj
• 82,880 points
1,031 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
714 views