Hello friends,
If you want to combine 2 arrays in which 1 is used as a key and another as value then you can use a predefined PHP function which is "array_combine". array_combine function creates an array by using one array for keys and anothe...
Hi All,
Slug :- It is a part of the URL to makes the URL more user-friendly. There are also many other advantages of the Slug. Firstly, search engines such as Google will rank your page higher for the keywords contained in the URL Secondly, us...
Cookies are the records which are stores in users PC, cookies are intended to store an unobtrusive measure of data/information and the information can be gotten to by customer or web server.
There are taking after kind of cookies:-
1. Ses...
Hello friends,
Here I am explaining that if you want to get all the values from a specific column from a multidimensional array then you can use a php predefined function which is "array_column()".
array_column returns the values from a sing...
Hello Readers ,
Suppose we have two array's .
$fname=array("Peter","Ben","Joe");
$age=array("35","37","43");
The array_combine() function creates an array by using the elements from one "keys" array and one "values" array.
Example ...
To find the number of days until a particular date you need to write the following PHP script:
<?php
$date1="December 31,2015";
$date2=strtotime($date1);
$date3=ceil(($date2-time())/60/60/24);
echo "There are " . $date3 ." days until $d...
Hello Readers ,
If we want to split one array into bunches of new arrays then their is a PHP function named "array_chunk()" that we can use.
The array_chunk() function splits an array into chunks of new arrays.
<!DOCTYPE html>
<...
Hello Readers ,
If we want to change the array key lower case to uppercase and vice versa then their is PHP function array_change_key_case() .
Example.
<!DOCTYPE html>
<html>
<body>
<?php
$age=array("Peter"=...
Hello friends,
Here I am explaining, if you want to split an array into given size element(length) of arrays then you can use array_chink() predefined function of php. array_chunk function chunks an array into arrays with size elements and may...
In PHP, to display the dates for the next six saturdays you need to write the following script.
<?php
$startdate=strtotime("Saturday");
$enddate=strtotime("+6 weeks",$startdate);
while ($startdate < $enddate) {
echo date("M d",...
"Back-End Testing" and "DB Testing" is the same term. In this we use to verify the DB with regard to the data which we submit though UI / getting delivered on the UI. Major entity around which the whole testing activity revolves is "Data". Some o...
Hello friends,
If you want to change the array keys in either upper case or lower case then you can use a predefined array function of PHP which is "array_change_key_case()". array_change_key_case returns an array with all keys from array lowe...
You can replace all instance in a string using str_replace with the help of str_replace function.
In this example, str_replace replaces all instances of abc with xyz like this:
echo str_replace("abc","xyz","abcdefghijklmn");
the output w...
There are many predefined Filter Constants in PHP which is passed as a second parameter value in the filter_var() function. Some of them are:
FILTER_VALIDATE_BOOLEAN: Used to validate a boolean.
FILTER_VALIDATE_EMAIL: It is used to validate...
Hello Friends,
I am getting the following error message when using customer payment in openerp-6.1 to validate the customer payment.
The error massage is shown below:
To reconcile the entries company should be the same for all entries in o...
You can easily replace a part of string at a given postion of a substring with the help of string function known as substr_replace
$string2="abcdefghijklmnop";
if (strpos($string2,"abcd")!==false)
{
$pos=strpos("abcd",$string2);
$l...
To sanitize and validate a URL a function filter_var() is used. It also removes all the illegal characters from the URL. It includes two parameters one is the variable that is needed to check and other is the type of the variable. If you want to...
Bootstrap is the framework in which responsive designs can be made. Responsive design means which can be fit to any device of any resolution
Bootstrap is a free front-end framework for faster and easier web development
Bootstrap inc...
<-- Chapter 16: SQL And & Or
Chapter 17
SQL ORDER BY
ORDER BY is the keyword used to sort the database table data by one or more columns. ORDER BY sort the Records in Ascending order by default. To sort the Record in Descending Ord...
In openerp It will first clean the leave intervals, to have an ordered list of not-overlapping intervals and initiate the current interval to be the base interval then before finishing skip the current interval and go to next beginning after the ...
In PHP, to validate and sanitize external input filters are used. filter_var() function is used which perform both validate and sanitize external input. It takes two parameter:
variable: It specify the variable you want to check.
type: It s...
Token Is the unique identification assigned to every registered user on the time of creation. Each user is maintained in that portal or site using this token id. Token are also used for resetting user password in .NET application W...
In today's world of internet, Email become one of the most popular and demanded service. Email become a necessary part of web development, email can be generate and send on different events such as registration of new users, activation of account...
QA process had several phases used in most companies, which are following:-
1.) Test Plan
2.) Test Cases
3.) Review
4.) Execute
5.) Improve
6.) Defects logging
1.) Test Plan: - We have to make test plan/arrangement in which we need ...
<-- Chapter 15: SQL <= Operator
Chapter 16
SQL And & Or
AND/OR Operators are used in SQL statements to filter the Records based on more than one condition. AND Operator display the records in which all the specified conditions a...
What Are Load Generator And Load Testing ?
Load Generator:-Load generator is an approach which pretended load to execute performance testing. Load generator can perform the sql performance testing or simultaneity testing. This is a method by w...
Hi All,
I recently required to created a custom pagination with the help of Bootstrap in my core PHP project. I thought that my code may help others also who wish to create the same.
The reason why I am using Bootstrap is as it ease our wor...
Find the number of words in a string:
In PHP, to find number of words in a string a function str_word_count() is used. It includes three parameters:
string: It a required parameter which specify the string to check.
return:It is an optiona...
Hello Readers ,
For preventing SQL injection we can do by two ways :
1- > Escaping the special characters in your post or get variables , or
2-> By using a parameterized query.
Both would protect you from SQL injection.
Ex...
<-- Chapter 11: SQL BETWEEN Operator
Chapter 12
SQL > Operator
Lets see an example from the below table "employees" :-
employee_id
name
code
designation
salary
101
ABC
E-101
Engineer
12000
102
DEF
E-...
In PHP, to search for a specific text within a string a function strpos() is used. It includes 3 parameters:
string: It is required parameter which specify the string to search.
find: It is also a required parameter which specify the string t...
Indexes in MongoDB effective execution of query, Otherwise MongoDB must scan all documents inside of the collection to fetch document match the find statement. This scanning process is profoundly inefficient and require the MongoDB to handle a va...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss How to use base64_encode() in PHP ?
If you want to convert any string into MIME base64 then base64_encode() function is very useful and simple process
let see syntax of bas...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss How to upload restrict file in PHP ?
If you want upload only jpg, gif image and other type of images not allow to upload
then, you have to use bellow php code:
<?php
...
<-- Chapter 10: SQL LIKE Operator
Chapter 11
SQL BETWEEN Operator
Lets see an example from the below table "employees" :-
employee_id
name
code
designation
salary
101
ABC
E-101
Engineer
12000
102
DEF
E-...
Hi Reader's,
Welcome to FindNerd, today we are going to discuss What is process to make custom session timeout in php ?
If you want to make the custom php session which will destroy automatic when page is not refreshing so long time.
yo...
<-- Chapter 9: SQL != Operator
Chapter 10
SQL LIKE Operator
Lets see an example from the below table "employees" :-
employee_id
name
code
designation
salary
101
ABC
E-101
Engineer
12000
102
DEF
E-102
D...
Related is used to define value of a related field which is given by following a sequence of relational fields and reading a field on the reached model. The complete sequence of fields to traverse is specified by the attribute and records.
Exam...
To delete data from a table we can use either DELETE or TRUNCATE.
DELETE
If we want to delete a record from table then we use DELETE FROM statement.
Syntax:
Below statement deletes rows from table on the basis of where condition, we...
Hello Readers,
In this blog we will discuss how to use the jQuery .is() method. Jquery .is() method is an important filtering method used generally in callback functions like event handlers.
If there no element fits, or the selector...
The reason of computed fields is been used is because it defines a filed whose value is computed rather then simply being read from the database.
Below are the attributes that are specific to computed fields. To define such a field, simply provi...
compute value is used to show the res.partner value and return a decorator that specifies the field dependencies of a "compute" method (for new-style function fields). Each argument must be a string that consists in a dot-separated sequence of fi...
If you want to show the database value and In the "traditional" style you can use method decorators.
Here parameters like the database cursor, user id, context dictionary and record ids (usually denoted as cr,uid, context, ids) a...
Hello friends,
Today I am here to explain the control flow function of mysql. Some times you want to get the result with respect to some conditions then you can use these functions.
Here are 4 type of control flow function which are following...
Hello friends,
Today I am here to explain you that how to replace all white spaces with a single space in php with the help of pregamatch method. You can use following method.
$input = 'Hello firends. how are you.';
$outpu...
UPPER(str)
UPPER() function returns the string str with all characters changed to uppercase according to the current character set mapping means if you want to get a string with all character in upper case then you can use this function.
He...