Posts with the tag php:

PHP cheatsheet

PHP Array Functions array_diff (arr1, arr2 …) array_filter (arr, function) array_flip (arr) array_intersect (arr1, arr2 …) array_merge (arr1, arr2 …) array_pop (arr) array_push (arr, var1, var2 …) array_reverse (arr) array_search (needle, arr) array_walk (arr, function) count (count) in_array (needle, haystack) PHP String Functions crypt (str, salt) explode (sep, str) implode (glue, arr) nl2br (str) sprintf (frmt, args) strip_tags (str, allowed_tags) str_replace (search, replace, str) strpos (str, needle) strrev (str) strstr (str, needle) strtolower (str) strtoupper (str) substr (string, start, len) PHP Filesystem Functions clearstatcache () copy (source, dest) fclose (handle) fgets (handle, len) file (file) filemtime (file) filesize (file) file_exists (file) fopen (file, mode) fread (handle, len) fwrite (handle, str) readfile (file) PHP Date and Time Functions checkdate (month, day, year) date (format, timestamp) getdate (timestamp) mktime (hr, min, sec, month, day, yr) strftime (formatstring, timestamp) strtotime (str) time () PHP Regular Expres­sions Functions ereg (pattern, str) split (pattern, str) ereg_replace (pattern, replace, str) preg_grep (pattern, arr) preg_match (pattern, str) preg_match_all (pattern, str, arr) preg_replace (pattern, replace, str) preg_split (pattern, str) Regular Expres­sions Syntax regex meaning ^ Start of string $ End of string .

[FIXED] I Can Not Create Database in PhpMyAdmin on my website

When I try to create database in phpMyAdmin. This error show up access denied for user 'user'@'localhost' to database 'db'. and there is no buttons to create database in phpMyAdmin page. On CPanel, we can’t create database in phpMyAdmin directly so security reasons. So the fix is to create MySQL database via CPanel not in phpMyAdmin. So, when using CPanel we create Database using Database Wizard as you see in this video. The steps is simple. just open CPanel on your host, and select MySQL Database Wizard, then write the name of database. And create a database user with password, and give all the privileges to that user.

[Solved] Parse Error : Syntax Error in wp-include/functions.php

I faced this error parse error : syntax error, unexpected "." , expecting "&" or variable (T_VARIABLE) in wp-include/functions.php on line 1081. This error is because there is two PHP versions loaded on the modules. So we should comment out one of them. So I commented out the php5 module. And everything worked fine. First step, edit the httpd.conf file using this command. sudo nano /etc/apache2/httpd.conf Then add a # in front of the php5 module (or one of the two versions of PHP you have). Make sure that one PHP version is enabled. Then save the file, and restart apache server using this command.

Is Go better than PHP?

First, “web development” is a very broad term and might, therefore, mean a lot of things including server-side rendered HTML pages, JSON APIs, microservices, etc. Second, let’s define what makes a programming language qualify for web development. (sorted by importance) Ecosystem Tooling Libraries Developer market Success stories Maintainability Language design Ecosystem consistency Performance Asynchronous execution for increased throughput Low latency Raw number-crunching performance Infrastructure Hosting and deployment Memory usage and cost in general So, let’s get ready to compare! Ecosystem (it depends) Both PHP and Go have created huge web-development ecosystems but they are focusing on different goals.

Laravel – Documentation and Code Snippets

Laravel is a framework for backend development for websites. It is written in PHP programming language. We use PHP to write website backend code in Laravel framework. A list of operators on Eloquent’s where() method When you use Eloquent’s where() method, by default it will use the = operator (i.e. ->where('fieldname','value') will generate ... WHERE fieldname = 'value'.... However you are not limited to just =. You can do something like this: $posts = Post::where("id","!=",123)->get() Any of the following may be used as the second parameter (and use the third param for the value) =, <, >, <=, >=, <>, !