Trending questions in PHP

0 votes
1 answer

How to submit form without page reloading?

Hello @kartik, If you put an Iframe in ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,840 points
2,013 views
0 votes
1 answer

How to set upload_max_filesize in .htaccess?

Hello @kartik, php_value upload_max_filesize 30M is correct. You will have ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,840 points
1,288 views
0 votes
1 answer

How to get the files inside a directory?

Hello @kartik, There's a lot of ways. The ...READ MORE

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

How can I get the classname from a static call in an extended PHP class?

Hello @kartik, __CLASS__ always returns the name of the ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,840 points
1,042 views
0 votes
1 answer

Error:Add myBundle to the asseticBundle config symfony2 exception?

Hello @kartik, Try the below steps: edit app/config/config.yml then go to assetic: under ...READ MORE

Nov 10, 2020 in PHP by Niroj
• 82,840 points
416 views
0 votes
1 answer

How to display HTML tags as plain text ?

Hello @kartik, Replace < with &lt; and& ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,840 points
2,756 views
0 votes
1 answer

How to save MySQL query output to excel or .txt file?

Hello @kartik, You can write following codes to ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,840 points
3,958 views
0 votes
1 answer

How to change public folder to public_html in laravel 5?

Hello, you can register the following code at Application ...READ MORE

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

How to prevent my site page to be loaded via 3rd party site frame of iFrame?

Hello @kartik, You cannot check it from the ...READ MORE

Oct 19, 2020 in PHP by Niroj
• 82,840 points
1,343 views
0 votes
1 answer

How to generate .json file with PHP?

Hello @kartik, Here is a sample code: <?php $sql="select ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,840 points
2,791 views
0 votes
1 answer

How to properly indent PHP/HTML mixed code?

The PHP and the HTML should each ...READ MORE

Oct 29, 2020 in PHP by Niroj
• 82,840 points
902 views
0 votes
1 answer

How do I receive email and process it in a web application?

Use procmail if it is installed on ...READ MORE

Nov 4, 2020 in PHP by Niroj
• 82,840 points
628 views
0 votes
1 answer

How to Initializing Multiple PHP Variables Simultaneously?

Hello @kartik, Simply try this: $first = $second = ...READ MORE

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

How to get innerHTML of DOMNode?

Hello @kartik, Here is a version in a functional ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,840 points
1,171 views
0 votes
1 answer

Notice: Undefined index: bid in C:\xampp\htdocs\userac\courier_management_system-master\courier_management_system-master\addstaff.php on line 130

Hello @saima , Before you extract values from $_POST ,$_SESSION, ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,840 points
2,856 views
0 votes
1 answer

How to get Real IP from Visitor?

Hello @kartik, Try this php code. <?PHP function getUserIP() { ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,840 points
1,854 views
0 votes
1 answer

How to make form_rest() not display a field with Symfony2?

Hello @kartik, Another option is to explicitly mark ...READ MORE

Oct 20, 2020 in PHP by Niroj
• 82,840 points
1,233 views
0 votes
1 answer

How to remove duplicate values from an array in PHP?

Hello @kartik, Use array_unique(): Example: $array = array(1, 2, 2, 3); $array ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,840 points
2,738 views
0 votes
1 answer

How to parse JSON and access results?

Hello, Try: $result = curl_exec($cURL); $result = json_decode($result,true); Now you can ...READ MORE

Nov 4, 2020 in PHP by Niroj
• 82,840 points
548 views
0 votes
1 answer

How to create an interface composed of other interfaces?

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

Nov 5, 2020 in PHP by Niroj
• 82,840 points
491 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,656 views
0 votes
1 answer

How to get current PHP page name?

Hello @kartik, You can use basename() and $_SERVER['PHP_SELF'] to get current page ...READ MORE

Aug 28, 2020 in PHP by Niroj
• 82,840 points
3,407 views
0 votes
1 answer

How to execute PHP code from the command line?

Hello @kartik, the php command offers two switches to ...READ MORE

Oct 1, 2020 in PHP by Niroj
• 82,840 points
1,883 views
0 votes
1 answer

How to execute a MySQL command from a shell script?

Hello @kartik, You need to use the -p flag to ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,840 points
3,671 views
0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

Aug 4, 2020 in PHP by Niroj
• 82,840 points
4,310 views
0 votes
1 answer

How do you create optional arguments in php?

Hello @kartik, Use an equals (=) sign in ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,840 points
2,402 views
0 votes
1 answer

How to get the location from an IP address?

Hello @kartik, You could download a free GeoIP ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,840 points
2,403 views
0 votes
1 answer

Catchable fatal error: Argument 1 passed to ClassA::method_a() must be an instance of ClassB, instance of ClassWrong given..

Hello @kartik, This is not a catchable fatal ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,840 points
811 views
0 votes
1 answer

How to access class constants in Twig?

Hello @kartik, Try this: {% if var == constant('Namespace\\Entity::TYPE_PERSON') ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,840 points
3,344 views
0 votes
1 answer

How do I add PHP code/file to HTML(.html) files?

Hello @kartik, You can't run PHP in .html ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,840 points
667 views
0 votes
1 answer

How to creat and Update Laravel Eloquent?

Hello @kartik, Here's a full example of what ...READ MORE

Oct 19, 2020 in PHP by Niroj
• 82,840 points
723 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,653 views
0 votes
1 answer

How to Convert timestamp to readable date/time PHP?

Hello @kartik, Use PHP's date() function. Example: echo date('m/d/Y', 1299446702); Hope it helps!! Thank ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,840 points
2,154 views
0 votes
1 answer

How to delete element by value in array (not key) using php?

Hello @kartik, Using array_search() and unset, try the following: if (($key = ...READ MORE

Sep 16, 2020 in PHP by Niroj
• 82,840 points
2,064 views
0 votes
1 answer

How can I use Sockets.io on the client side and communicate with a PHP based application on the server?

Hello @kartik, For 'long-lived connection' , you can ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,840 points
3,039 views
0 votes
1 answer

Error:No Application Encryption Key Has Been Specified

Hello @kartik, Open command prompt in the root ...READ MORE

Jul 22, 2020 in PHP by Niroj
• 82,840 points
4,452 views
0 votes
1 answer

How to use PHP's password_hash to hash and verify passwords?

Hello @kartik, Using password_hash is the recommended way to store ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,840 points
1,119 views
0 votes
1 answer

How can I select and upload multiple files with HTML and PHP using HTTP POST?

Hello @kartik, This is possible in HTML5. Example (PHP ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,840 points
1,995 views
0 votes
1 answer

How to convert PHP code to MySQL query to CSV?

Hello @kartik, Try this: SELECT * INTO OUTFILE "c:/mydata.csv" FIELDS ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,840 points
3,097 views
0 votes
1 answer

How do I disable the views caching?

Hello @kartik, There is now a php artisan view:clear command ...READ MORE

Oct 1, 2020 in PHP by Niroj
• 82,840 points
1,276 views
0 votes
1 answer

How to Insert multiple rows in a single SQL query?

Hello @kartik, In SQL Server you can insert ...READ MORE

Jul 21, 2020 in PHP by Niroj
• 82,840 points
4,386 views
0 votes
1 answer

How to get WordPress post featured image URL?

Hello @kartik, Try this code below: <?php if (has_post_thumbnail( $post->ID ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,840 points
3,308 views
0 votes
1 answer

How to move columns in a MySQL table?

Hello @kartik, If empName is a VARCHAR(50) column: ALTER ...READ MORE

Aug 19, 2020 in PHP by Niroj
• 82,840 points
3,069 views
0 votes
1 answer

How to get the request parameters in symfony2

Hello @kartik, The naming is not all that ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,840 points
3,159 views
0 votes
1 answer

How to trigger XDebug profiler for a command line PHP script?

Hello @kartik, You can pass INI settings with ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,840 points
1,654 views
0 votes
1 answer

How to alter a MySQL column to be AUTO_INCREMENT?

Hello @kartik, Try this: ALTER TABLE document MODIFY COLUMN ...READ MORE

Aug 19, 2020 in PHP by Niroj
• 82,840 points
2,888 views
0 votes
1 answer

Error: Warning: Illegal string offset 'host' in ....

Hello @kartik,  Try this way: $memcachedConfig = array("host" => ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,840 points
3,098 views
0 votes
1 answer

How PHP Replace last occurrence of a String in a String?

Hello @kartik, You can use this function: function str_lreplace($search, ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,840 points
2,961 views
0 votes
1 answer

How to search for highest key/index in an array?

Hello @kartik, This should work fine $arr = array( ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,840 points
642 views
0 votes
1 answer

Fatal error: Class 'SoapClient' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\server.php on line 2

Hello @kartik, To install SOAP in PHP-7 run ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,840 points
2,932 views