Trending questions in PHP

0 votes
1 answer

How to change public folder to public_html in laravel 5?

Hello @kartik, go to this address : /app/Providers/AppServiceProvider.php and append ...READ MORE

Nov 9, 2020 in PHP by Niroj
• 82,840 points
3,196 views
0 votes
1 answer

How do I find the mime-type of a file with php?

Hello @kartik, mime_content_type() is deprecated, so you won't ...READ MORE

Nov 16, 2020 in PHP by Niroj
• 82,840 points
2,887 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,840 points
2,566 views
0 votes
1 answer

Error: Call to undefined function money_format()

Hello @kartik, If you are using windows based ...READ MORE

Nov 16, 2020 in PHP by Niroj
• 82,840 points
2,783 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,840 points
4,012 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,840 points
12,392 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,840 points
2,453 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,840 points
3,084 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,840 points
3,171 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,840 points
2,602 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,840 points
4,680 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,840 points
6,491 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,840 points
12,214 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,840 points
2,323 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,840 points
4,368 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,840 points
2,727 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,840 points
3,069 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,840 points
2,811 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,840 points
12,024 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,840 points
2,917 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,840 points
2,091 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,840 points
3,511 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,840 points
3,062 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,840 points
2,755 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,840 points
3,134 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,840 points
3,093 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,840 points
2,127 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,840 points
2,246 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,840 points
2,875 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,840 points
2,122 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,840 points
1,944 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,840 points
5,225 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,840 points
3,143 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,840 points
1,557 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,840 points
1,521 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,840 points
2,231 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,840 points
4,404 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,840 points
5,778 views
0 votes
1 answer

How to grant remote access permissions to mysql server for user?

Hello @kartik, This grants root access with the ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,840 points
5,173 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,840 points
1,360 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,840 points
2,682 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,840 points
2,084 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,840 points
2,140 views
0 votes
1 answer

How can I handle the warning of file_get_contents() function in PHP?

Hello @kartik, This is fairly simple: if (!$data = ...READ MORE

Apr 7, 2020 in PHP by Niroj
• 82,840 points
11,180 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,840 points
2,025 views
0 votes
1 answer

How to prevent direct access to a php include file?

Hello @kartik, Add this to the page that ...READ MORE

Oct 1, 2020 in PHP by Niroj
• 82,840 points
3,487 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,520 points
1,526 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,840 points
1,581 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,840 points
696 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,840 points
1,118 views