Archive for the ‘PHP’ Category

How to perform case insensitive array search in php?

Searching is a usual and regular task in programming. Letters case sensitivity is a problematic in searching. Hence, both search string and array string should be converted into same case before searching. Otherwise searching would return the empty result. Here is how to do it: As shown above, search string is converted into lowercase and all the items of an array are converted to ... Full story

javascript new date not working in iphone and android devices with NAN and Undefined error

Today i found a new problem, the date object working perfectly in desktop web browsers but not working in android browsers and iphone browsers. The problem is they issue NAN and Undefined errors. So what is the universal solution? There is a simple solution to the problem. You should declare date as following format: If you are processing date from php then the ... Full story

How to show all errors in php?

Without editing php.ini it is possible to display almost all errors in php by adding following 3 lines of codes on the top of the php page: Hope it helped you. If it helped please do not forget to comment below. Thanks. Full story

How to solve PHP Warning: mysqli_connect(): (HY000/2002): Connection refused problem?

The default port on MAMP for mysql is 8889, but the port that php expects to use for mysql is 3306. So you need to change it. Open MAMP, go to Preferences and Ports and change the MAMP mysql port to 3306, then click ok. Then mysql server will be restarted by MAMP if not then restart it manually. Now the connection should be successful ... Full story

How to solve MySql not starting in MAMP problem?

In mac if you have ever encountered a problem that MySQL suddenly stopped working then i have a solution to your problem. I have recently encountered this problem in my Mac OS Sierra. Apache server is working but mysql is not. The solution is to navigate to the mysql folder, in my case its, /Applications/MAMP/db/mysql56/ and remove all the files except ... Full story

How do get PHP Errors to display?

To get PHP errors to display without modifying php.ini add the following codes to the top of the php file: However, it won't show parse errors. To show parse errors modify your php.ini with this line: Full story

How to solve “Access forbidden! You don’t have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403 localhost Mon 24 Oct 2011 07:45:12 PM NPT Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c PHP/5.3.5 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1” problem?

Some times while we wish to run any project on xamp or wamp or lampp we might this error message as: Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403 localhost Mon 24 Oct 2011 07:45:12 PM NPT Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c PHP/5.3.5 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 ... Full story

How to fetch / extract data using CURL in PHP?

This is an example that fetches then information that we get while we search in google as define:words. Full story
Copyright © 2024 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes