tag:blogger.com,1999:blog-82559590720459206802024-02-08T01:00:25.438+05:30TECHIE SNACKSBelieve Your Self balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.comBlogger96125tag:blogger.com,1999:blog-8255959072045920680.post-77501770804826213212023-04-06T14:01:00.004+05:302023-04-06T14:01:28.958+05:30Backup files to google drive using PHP coding<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;">To backup files to Google Drive using PHP coding, you can use the Google Drive API and the Google Client Library for PHP. Here's an example code snippet that shows how to upload a file to Google Drive:</span></p><p><b style="color: #2b00fe; font-family: Calibri; font-size: large;">PHP code</b></p><p><span style="font-family: Calibri; font-size: medium;"><?php</span></p><p><span style="font-family: Calibri; font-size: medium;">require_once __DIR__ . '/vendor/autoload.php'; // Include Google Client Library</span></p><p><span style="font-family: Calibri; font-size: large;">// Set up the credentials</span></p><p><span style="font-family: Calibri; font-size: medium;">$client = new Google_Client();</span></p><p><span style="font-family: Calibri; font-size: medium;">$client->setAuthConfig('client_secret.json'); // Replace with your own credentials file</span></p><p><span style="font-family: Calibri; font-size: medium;">$client->addScope(Google_Service_Drive::DRIVE_FILE);</span></p><p><span style="font-family: Calibri; font-size: large;">// Authenticate the user</span></p><p><span style="font-family: Calibri; font-size: medium;">if ($client->isAccessTokenExpired()) {</span></p><p><span style="font-family: Calibri; font-size: medium;"> $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());</span></p><p><span style="font-family: Calibri; font-size: medium;">}</span></p><p><span style="font-family: Calibri; font-size: large;">// Create a new Google Drive client</span></p><p><span style="font-family: Calibri; font-size: medium;">$service = new Google_Service_Drive($client);</span></p><p><span style="font-family: Calibri; font-size: large;">// File to upload</span></p><p><span style="font-family: Calibri; font-size: medium;">$file_path = '/path/to/backup.zip';</span></p><p><span style="font-family: Calibri; font-size: medium;">$file_name = 'backup.zip';</span></p><p><span style="font-family: Calibri; font-size: large;">// Upload file to Google Drive</span></p><p><span style="font-family: Calibri; font-size: medium;">$file = new Google_Service_Drive_DriveFile();</span></p><p><span style="font-family: Calibri; font-size: medium;">$file->setName($file_name);</span></p><p><span style="font-family: Calibri; font-size: large;">$file->setParents(array('your_folder_id')); // Replace with the ID of the folder to upload the file to</span></p><p><span style="font-family: Calibri; font-size: large;">$content = file_get_contents($file_path);</span></p><p><span style="font-family: Calibri; font-size: medium;">$file = $service->files->create($file, array(</span></p><p><span style="font-family: Calibri; font-size: medium;"> 'data' => $content,</span></p><p><span style="font-family: Calibri; font-size: medium;"> 'mimeType' => 'application/zip',</span></p><p><span style="font-family: Calibri; font-size: medium;"> 'uploadType' => 'multipart'</span></p><p><span style="font-family: Calibri; font-size: medium;">));</span></p><p><span style="font-family: Calibri; font-size: large;">// Print the ID of the newly created file</span></p><p><span style="font-family: Calibri; font-size: medium;">echo 'File ID: ' . $file->id;</span></p><p><span style="font-family: Calibri; font-size: medium;">?></span></p><p><span style="font-family: Calibri; font-size: medium;">In this code, I first include the Google Client Library using require_once __DIR__ . '/vendor/autoload.php'. Then, I set up the credentials by creating a new Google_Client instance and specifying the location of the credentials file.</span></p><p><span style="font-family: Calibri; font-size: large;">Then authenticate the user by fetching the access token with the refresh token, if the access token is expired.</span></p><p><span style="font-family: Calibri; font-size: large;">Next, I create a new Google_Service_Drive instance and specify the scope for the Drive API.</span></p><p><span style="font-family: Calibri; font-size: large;">I define the file to upload by specifying the file path and name. For specify the ID of the folder to upload the file to.</span></p><p><span style="font-family: Calibri; font-size: large;">Finally, I use the files->create() method to upload the file to Google Drive. This method takes the file object and an array of options as parameters. In this case, I specify the file content, MIME type, and upload type.</span></p><p><span style="font-family: Calibri; font-size: large;">If the file is uploaded successfully, I print the ID of the newly created file. Note that you need to replace the credentials file and folder ID with your own values.</span></p>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-62309592523127481302023-04-06T13:50:00.005+05:302023-04-06T13:50:41.107+05:30PHP Send Email with Attachments<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;">Here's an example code for attaching a file to an email in PHP using the built-in mail() function:</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="color: #2b00fe; font-family: Calibri; font-size: medium;"><b>Php code</b></span></p><p><span style="font-family: Calibri; font-size: medium;">// recipient email address</span></p><p><span style="font-family: Calibri; font-size: medium;">$to = "recipient@test.com";</span></p><p><span style="font-family: Calibri; font-size: large;">// email subject</span></p><p><span style="font-family: Calibri; font-size: medium;">$subject = "Test email with attachment";</span></p><p><span style="font-family: Calibri; font-size: large;">// email message</span></p><p><span style="font-family: Calibri; font-size: medium;">$message = "This is a test email with attachment.";</span></p><p><span style="font-family: Calibri; font-size: large;">// attachment file path</span></p><p><span style="font-family: Calibri; font-size: medium;">$file_path = "/path/to/attachment.pdf";</span></p><p><span style="font-family: Calibri; font-size: large;">// attachment file name</span></p><p><span style="font-family: Calibri; font-size: medium;">$file_name = "attachment.pdf";</span></p><p><span style="font-family: Calibri; font-size: large;">// read attachment file contents</span></p><p><span style="font-family: Calibri; font-size: medium;">$file_content = file_get_contents($file_path);</span></p><p><span style="font-family: Calibri; font-size: large;">// encode attachment file contents in base64</span></p><p><span style="font-family: Calibri; font-size: medium;">$file_content = base64_encode($file_content);</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;">// email headers</span></p><p><span style="font-family: Calibri; font-size: medium;">$headers = "MIME-Version: 1.0" . "\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$headers .= "From: sender@example.com" . "\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$headers .= "Cc: cc@example.com" . "\r\n";</span></p><p><span style="font-family: Calibri; font-size: large;">// email boundary</span></p><p><span style="font-family: Calibri; font-size: medium;">$boundary = "boundary_" . md5(uniqid(time()));</span></p><p><span style="font-family: Calibri; font-size: large;">// email body</span></p><p><span style="font-family: Calibri; font-size: medium;">$body = "--$boundary\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "Content-Type: text/html; charset=UTF-8\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "$message\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "--$boundary\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "Content-Type: application/pdf; name=\"$file_name\"\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "Content-Disposition: attachment; filename=\"$file_name\"\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "Content-Transfer-Encoding: base64\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= chunk_split($file_content) . "\r\n";</span></p><p><span style="font-family: Calibri; font-size: medium;">$body .= "--$boundary--";</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;">// send email with attachment</span></p><p><span style="font-family: Calibri; font-size: medium;">if(mail($to, $subject, $body, $headers)) {</span></p><p><span style="font-family: Calibri; font-size: medium;"> echo "Email sent with attachment.";</span></p><p><span style="font-family: Calibri; font-size: medium;">} else {</span></p><p><span style="font-family: Calibri; font-size: medium;"> echo "Failed to send email with attachment.";</span></p><p><span style="font-family: Calibri; font-size: medium;">}</span></p><p><span style="font-family: Calibri; font-size: medium;">In the above code, I first specify the recipient email address, email subject, and email message. I also provide the file path and name of the file to be attached.</span></p><p><span style="font-family: Calibri; font-size: large;">I then read the contents of the file and encode it in base64 format. I also specify the email headers, including the MIME version, content type, and sender and cc email addresses.</span></p><p><span style="font-family: Calibri; font-size: large;">I specify the email boundary and create the email body, which includes the message and the attachment. The attachment is added as a separate section in the email body with the appropriate content type and encoding.</span></p><p><span style="font-family: Calibri; font-size: large;">Finally, I use the mail() function to send the email with the attachment. If the email is sent successfully, I display a success message. Otherwise, we display an error message.</span></p><div><br /></div>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-52396242864287326392023-04-06T13:42:00.004+05:302023-04-06T13:42:52.174+05:30What is a stored procedure in MySQL? What to do with it.<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;">A stored procedure in MySQL is a set of SQL statements that are stored in the database and can be executed later as a single unit. Stored procedures can help improve database performance by reducing network traffic, as well as enhancing security by allowing access to the database through procedures instead of directly executing SQL queries.</span></p><p><span style="font-family: Calibri; font-size: medium;">To create a stored procedure in MySQL, you can use the CREATE PROCEDURE statement, followed by the procedure name and the SQL statements that make up the procedure. The syntax for creating a stored procedure in MySQL is as follows:</span></p><p><span style="color: #2b00fe; font-family: Calibri; font-size: medium;"><b>Format 1:</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>CREATE PROCEDURE procedure_name (IN parameter_name datatype, OUT parameter_name datatype, INOUT parameter_name datatype)</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>BEGIN</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b> -- SQL statements</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>END;</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="color: #2b00fe; font-family: Calibri; font-size: medium;"><b>Format 2:</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>CREATE PROCEDURE procedure_name ([IN | OUT | INOUT] parameter_name data_type)</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>BEGIN</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b> -- SQL statements here</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>END;</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The IN keyword is used to specify input parameters, the OUT keyword is used to specify output parameters, and the INOUT keyword is used to specify input/output parameters. You can specify one or more parameters, separated by commas.</span></p><p><span style="font-family: Calibri; font-size: medium;">Here is an example of a stored procedure that accepts an IN parameter and returns a result set:</span></p><p><span style="font-family: Calibri; font-size: large;"><b>CREATE PROCEDURE get_customer_orders(IN customer_id INT)</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>BEGIN</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b> SELECT * FROM orders WHERE customer_id = customer_id;</b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>END;</b></span></p><p><span style="font-family: Calibri; font-size: large;">Once you have created a stored procedure, you can execute it using the CALL statement, followed by the procedure name and any input parameters. The syntax for calling a stored procedure in MySQL is as follows:</span></p><p><span style="font-family: Calibri; font-size: medium;"><b>CALL procedure_name(input_parameter);</b></span></p><p><span style="font-family: Calibri; font-size: large;">Here is an example of calling the get_customer_orders stored procedure:</span></p><p><span style="font-family: Calibri; font-size: large;"><b>CALL get_customer_orders(123);</b></span></p><p><span style="color: #2b00fe; font-family: Calibri; font-size: medium;">This will return all the orders for the customer with the ID of 123.</span></p><p><span style="font-family: Calibri; font-size: medium;">In the procedure body, you can use various SQL statements such as SELECT, UPDATE, DELETE, and so on to perform various database operations. You can also use control structures such as IF, WHILE, and FOR to control the flow of the procedure.</span></p><p><span style="font-family: Calibri; font-size: medium;">Stored procedures can also have exception handling using the DECLARE HANDLER statement to catch and handle errors.</span></p><p><span style="font-family: Calibri; font-size: medium;">Overall, stored procedures provide a powerful mechanism for encapsulating SQL logic in the database itself and reducing the amount of code that needs to be written in the application layer.</span></p><div><br /></div>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-47664727955954641472023-04-06T13:21:00.007+05:302023-04-06T13:43:04.034+05:30Crake a MySql interview questions and answers of part 2<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><b><br /></b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>11. What is the difference between the INNER JOIN and OUTER JOIN in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">INNER JOIN returns only the rows that have matching values in both tables being joined, while OUTER JOIN returns all the rows from one table and the matching rows from the other table being joined.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>12. What is the use of the GROUP BY clause in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The GROUP BY clause is used to group rows based on the values in one or more columns. It is commonly used in conjunction with aggregate functions such as COUNT, SUM, and AVG to calculate summary statistics for each group.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>13. What is the use of the DISTINCT keyword in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The DISTINCT keyword is used to return only unique values in a specified column. It is often used in conjunction with the SELECT statement to remove duplicates from the results.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>14. What is the use of the INDEX keyword in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The INDEX keyword is used to create an index on one or more columns in a table. Indexes can improve the performance of queries that involve the indexed columns, as they allow for faster lookups of specific values.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>15. What is the difference between the DATE and DATETIME data types in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The DATE data type stores only the date, while the DATETIME data type stores both the date and time. DATE is more efficient for storing only dates, while DATETIME is more flexible for storing date and time information.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>16. What is the use of the MAX and MIN functions in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The MAX function returns the maximum value in a specified column, while the MIN function returns the minimum value in a specified column. They are often used in conjunction with the GROUP BY clause to calculate summary statistics for each group.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>17. What is the use of the NULL keyword in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The NULL keyword represents a missing or unknown value in a column. It can be used in comparison operations and in the WHERE clause to filter results based on the presence or absence of a value.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>18. What is the difference between a primary key and a unique key in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A primary key is a column or set of columns that uniquely identifies each row in a table and cannot contain NULL values, while a unique key is a column or set of columns that must contain unique values but can contain NULL values.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>19. What is the use of the HAVING clause in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The HAVING clause is used to filter the results of a GROUP BY query based on aggregate functions such as COUNT, SUM, and AVG.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>20. What is the difference between a left join and a right join in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A left join returns all the rows from the left table and the matching rows from the right table, while a right join returns all the rows from the right table and the matching rows from the left table.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>21. What is the use of the CONCAT function in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The CONCAT function is used to concatenate two or more strings together. It takes any number of arguments and returns the concatenated string.</span></p><p><span style="font-family: Calibri; font-size: medium;"><b><br /></b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>22. What is the use of the IF function in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The IF function is used to conditionally return a value based on a specified condition. It takes three arguments: the condition to be evaluated, the value to return if the condition is true, and the value to return if the condition is false.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>23. What is the use of the UNION operator in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The UNION operator is used to combine the results of two or more SELECT statements into a single result set. The result set contains all the rows from each SELECT statement, with duplicates removed.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>24. What is the use of the EXISTS keyword in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The EXISTS keyword is used to test for the existence of rows in a subquery. It returns true if the subquery returns any rows, and false otherwise.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>25. What is the use of the TRUNCATE TABLE statement in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The TRUNCATE TABLE statement is used to delete all the rows from a table while preserving the table structure. It is faster and more efficient than the DELETE statement, as it does not generate as much transaction log activity.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>26. What is the use of the RAND function in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The RAND function is used to generate a random number between 0 and 1. It is often used in conjunction with the ORDER BY clause to randomize the order of the rows returned by a query.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>27. What is the use of the SHOW command in MySQL?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The SHOW command is used to display information about various aspects of the MySQL server, such as databases, tables, columns, and users. It can be used in conjunction with other keywords such as CREATE, ALTER, and DROP to perform database operations.</span></p><p><br /></p>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-55829017702935634782023-04-06T13:09:00.002+05:302023-04-06T13:43:16.496+05:30Crake a MySql interview questions and answers of part 1<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">1.What is a foreign key in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">A foreign key is a column or set of columns in a table that is used to establish a link between two tables. It is a reference to a primary key in another table and is used to maintain data integrity.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">2. What is the difference between CHAR and VARCHAR in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">CHAR is a fixed-length string type that is always the same size, while VARCHAR is a variable-length string type that can be up to a specified maximum size.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">3. What is the use of the GROUP BY clause in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The GROUP BY clause is used to group rows based on one or more columns in a table. It is often used with aggregate functions like COUNT, SUM, and AVG to generate summary reports.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">4.What is a stored procedure in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">A stored procedure is a set of SQL statements that are stored in the database and can be called by name from a client application. It is used to encapsulate complex logic and improve performance by reducing network traffic.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">5. What is the difference between DELETE and TRUNCATE in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">DELETE is a DML (Data Manipulation Language) statement that removes rows from a table based on a specified condition. TRUNCATE is a DDL (Data Definition Language) statement that removes all rows from a table and resets the auto-increment counter.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">6. What is the use of the JOIN clause in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The JOIN clause is used to combine rows from two or more tables based on a related column. It is often used to retrieve data from multiple tables in a single query.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">7. What is the use of the ORDER BY clause in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The ORDER BY clause is used to sort the rows in a result set based on one or more columns in ascending or descending order.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">8. What is the difference between UNION and UNION ALL in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">UNION combines the result sets of two or more SELECT statements into a single result set, removing any duplicates. UNION ALL does the same thing, but does not remove duplicates.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">9. What is the use of the IN operator in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The IN operator is used to specify a list of values to be matched in a WHERE clause. It is often used with the NOT operator to exclude certain values from a result set.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">10. What is the use of the LIMIT clause in MySQL?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The LIMIT clause is used to restrict the number of rows returned by a SELECT statement. It takes two parameters, the starting row and the number of rows to return, and is often used for pagination purposes.</span></p>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-39286334763351964632023-04-06T13:02:00.006+05:302023-04-06T13:10:50.476+05:30Crake a PHP interview questions and answers of part 2<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>16. What is the difference between a function and a method in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A function is a piece of code that can be called from anywhere in a script, while a method is a function that belongs to a specific object of a class and can only be called on that object.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>17. What is the difference between the array_merge and array_combine functions in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The array_merge function takes two or more arrays and merges them into a single array. The resulting array contains all the values of the original arrays. The array_combine function takes two arrays and combines them into a single associative array. The first array contains the keys of the new array, and the second array contains the values.</span></p><p><b><span style="font-family: Calibri; font-size: medium;"><br /></span></b></p><p><b><span style="font-family: Calibri; font-size: medium;">18. What is the use of the array_diff function in PHP?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The array_diff function is used to compare two or more arrays and return the values that are present in the first array but not in the others. It takes two or more arrays as input and returns an array with the values that are unique to the first array.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>19. What is the difference between require_once and include_once in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The require_once and include_once functions are similar to require and include, but they ensure that the file is included only once. If the file has already been included, PHP will not include it again. The difference between require_once and include_once is that require_once generates a fatal error if the file cannot be found, while include_once generates a warning.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>20. What is the use of the count function in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The count function is used to count the number of elements in an array or the number of characters in a string. It takes an array or string as input and returns the number of elements or characters.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>21. What is the use of the array_search function in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The array_search function is used to search an array for a specific value and return the key of the first matching element. It takes two parameters: the value to search for and the array to search.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>22. What is the difference between urlencode and rawurlencode in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The urlencode function encodes a string for use in a URL, replacing any special characters with their corresponding percent-encoded values. The rawurlencode function is similar, but it encodes all characters except letters, digits, and a few special characters.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>23. What is the use of the preg_match function in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The preg_match function is used to perform a regular expression match on a string. It takes two parameters: the regular expression pattern to search for and the string to search. If a match is found, the function returns true, otherwise it returns false.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>24. What is the difference between a static and a constant variable in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A static variable is a variable that retains its value between function calls. It is declared using the static keyword. A constant variable is a variable whose value cannot be changed during the execution of a script. It is declared using the const keyword.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>25. What is the use of the file_get_contents function in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;"></span></p><p><span style="font-family: Calibri; font-size: medium;">The file_get_contents() function is used to read the contents of a file into a string. It takes one parameter, which is the path to the file to be read.</span></p><p><span style="font-family: Calibri; font-size: medium;"><b><br /></b></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>26. What is the use of the header function in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The header() function is used to send HTTP headers to the browser. These headers can be used to set the content type, set cookies, and redirect the browser to another page.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>27. What is the difference between a single quote and a double quote in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">In PHP, single quotes are used to define a string literal, while double quotes allow for the interpolation of variables and escape sequences within the string.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>28. What is the difference between array_push and array_pop in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;"></span></p><p><span style="font-family: Calibri; font-size: medium;">array_push is used to add one or more elements to the end of an array, while array_pop is used to remove and return the last element of an array.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><b><span style="font-family: Calibri; font-size: medium;">29. What is the use of the header() function with a location parameter in PHP?</span></b></p><p><span style="font-family: Calibri; font-size: medium;">The header() function with a location parameter is used to redirect the user to a different page. It sends a 302 (temporary) or 301 (permanent) redirect header to the client, telling it to request the new page.</span></p><div><div><b><span style="font-family: Calibri; font-size: medium;">30. What is the use of the explode function in PHP?</span></b></div><div><span style="font-family: Calibri; font-size: medium;">The explode() function is used to split a string into an array, using a specified delimiter to determine where to split the string.</span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><b><span style="font-family: Calibri; font-size: medium;">31 .What is the use of the empty function in PHP?</span></b></div><div><span style="font-family: Calibri; font-size: medium;">The empty() function is used to determine if a variable is empty. It returns true if the variable is NULL, false, an empty string, an empty array, or has not been set.</span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><b><span style="font-family: Calibri; font-size: medium;">32. What is the use of the session_start function in PHP?</span></b></div><div><span style="font-family: Calibri; font-size: medium;">The session_start() function is used to start a new or resume an existing session. Sessions are used to store and retrieve data between page requests, allowing for persistent user data.</span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><b><span style="font-family: Calibri; font-size: medium;">33 .What is the use of the array_key_exists function in PHP?</span></b></div><div><span style="font-family: Calibri; font-size: medium;">The array_key_exists() function is used to check if a specified key exists in an array. It returns true if the key exists and false otherwise.</span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><b><span style="font-family: Calibri; font-size: medium;">34 .What is the use of the count function in PHP?</span></b></div><div><span style="font-family: Calibri; font-size: medium;">The count() function is used to count the number of elements in an array or the number of characters in a string.</span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div><div><span style="font-family: Calibri; font-size: medium;"><br /></span></div></div><div><br /></div>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-74662258230946325112023-04-06T12:37:00.007+05:302023-04-06T13:12:11.668+05:30Crake a PHP interview questions and answers of part 1<p><span style="font-family: Calibri; font-size: medium;"> Dear All,</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>1.What is the difference between == and === in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">== is a comparison operator that checks for equality of values, while === is a strict comparison operator that checks for equality of values and data types.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>2.What is the difference between include() and require()?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">include() and require() are both used to include files in PHP. The main difference is that require() will throw a fatal error if the file cannot be included, while include() will only throw a warning.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>3.What is the use of the global keyword in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The global keyword is used to access variables that are defined outside the current scope, such as variables defined in a different function or in the global scope.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>4.What is the use of the isset() function in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The isset() function is used to determine if a variable is set and is not null. It returns a boolean value (true or false).</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>5.What is the difference between echo and print in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">Both echo and print are used to output strings in PHP. The main difference is that echo can output multiple strings at once, while print can only output one string and returns a value of 1.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>6.What is a session in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A session is a way to store information about a user across multiple pages on a website. It allows you to store and retrieve user-specific data such as login credentials, preferences, and shopping cart contents.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>7.What is the use of the $_POST variable in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The $_POST variable is an array that stores data submitted by a form using the HTTP POST method. It allows you to retrieve data from the form and use it in your PHP script.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>8.What is the use of the $_SERVER variable in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">The $_SERVER variable is a superglobal array that contains information about the current script and the server environment. It can be used to retrieve information such as the URL of the current page, the IP address of the user, and the user agent string.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>9.What is the difference between a GET request and a POST request in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A GET request is used to retrieve data from the server, while a POST request is used to submit data to the server. GET requests are generally used for simple queries and do not involve changing the state of the server, while POST requests are used for more complex operations that involve changing the state of the server.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>10.What is a PHP trait and how is it used?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">A trait is a way to reuse code in PHP without using inheritance. It allows you to define a set of methods that can be included in multiple classes, without creating a hierarchy of classes. To use a trait, you simply include it in a class using the use keyword.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>11.How do you prevent SQL injection attacks in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">Answer: SQL injection attacks can be prevented by using prepared statements or parameterized queries with PDO or mysqli extensions in PHP. These methods will sanitize user input and ensure that malicious code cannot be injected into SQL statements.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>12.What is the use of "final" keyword in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">Answer: The "final" keyword in PHP is used to indicate that a class, method, or property cannot be extended or overridden by any child class. This provides an added layer of security and control over the code.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>13.What is the difference between "private" and "protected" visibility in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">Answer: "private" visibility in PHP restricts access to the property or method only within the class where it is defined, while "protected" visibility allows access to the property or method within the class as well as any child classes that extend it.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>14.What is the difference between "session" and "cookie" in PHP?</b></span></p><p><span style="font-family: Calibri; font-size: medium;">Answer: "Session" is a server-side storage mechanism that allows PHP to store user-specific data that can be accessed across different pages and requests. "Cookie" is a client-side storage mechanism that stores data in the user's browser and can be used to remember user preferences or login information. Cookies can be set to expire after a certain amount of time, while sessions expire when the user closes their browser or after a certain amount of inactivity.</span></p><p><span style="font-family: Calibri; font-size: medium;"><br /></span></p><p><span style="font-family: Calibri; font-size: medium;"><b>15.How do you debug PHP code?</b></span></p><p><span style="font-family: Calibri; font-size: medium;"></span></p><p><span style="font-family: Calibri; font-size: medium;">Answer: PHP code can be debugged using a variety of tools, including PHP's built-in error reporting, Xdebug, or third-party debugging tools such as PhpStorm or Visual Studio Code. Debugging tools can help identify and fix errors in PHP code more efficiently by providing features such as breakpoints, step-by-step execution, and variable inspection.</span></p>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-72684316469840453492021-05-27T19:29:00.001+05:302021-05-27T19:29:45.963+05:30Find The Missing Number In The Given Array List Using PHP<p><span style="font-family: Calibri;"> Hi All,</span></p><p><span style="font-family: Calibri;">Here, I have finding the Missing number from the array.</span></p><p><span style="font-family: Calibri;"><br /></span></p><p><span style="font-family: Calibri;"><b>Function:</b> sort();</span></p><p><span style="font-family: Calibri;"><b>Syntax:</b> sort(array, sorttype);</span></p><p><span style="font-family: Calibri;"><b>Description:</b> sorts an indexed array in ascending order.</span></p><p><span style="font-family: Calibri;"><br /></span></p><p><b style="font-family: Calibri;">Function: </b><span style="font-family: Calibri;">range();</span></p><p><span style="font-family: Calibri;"><b>Syntax: </b>range(low, high, step);</span></p><p><span style="font-family: Calibri;"><b>Description : </b>It creates an array containing a range of elements.</span></p><p><span style="font-family: Calibri;"> This function returns an array of elements from low to high.</span></p><p><b style="font-family: Calibri;"><br /></b></p><p><b style="font-family: Calibri;">Function:</b><span style="font-family: Calibri;"> </span><span style="font-family: Calibri;">max();</span></p><p><span style="font-family: Calibri;"><b>Syntax:</b> max(array_values); </span></p><p><span style="font-family: Calibri;"><span> </span><span> </span><span> </span><span> </span> or</span></p><p><span style="font-family: Calibri;"> max(value1,value2,...);</span></p><p><span style="font-family: Calibri;"><b>Description : </b>It returns the highest value in an array, or the highest value of several specified values.</span></p><p><span style="font-family: Calibri;"><br /></span></p><p><span style="font-family: Calibri;"><br /></span></p><p><span style="font-family: Calibri;"><?php </span></p><p><span style="font-family: Calibri;">function missing_number($num_order) </span><span style="font-family: Calibri;">{</span></p><p><span style="font-family: Calibri;">// Sort an array number for finding the first value of an array </span></p><p><span style="font-family: Calibri;">sort($num_order);</span></p><p><span style="font-family: Calibri;"> // construct a new array</span></p><p><span style="font-family: Calibri;">$new_array = range($num_order[0],max($num_order)); </span></p><p><span style="font-family: Calibri;">// use array_diff to find the missing elements </span></p><p><span style="font-family: Calibri;">return array_diff($new_array , $num_order);</span></p><p><span style="font-family: Calibri;">}</span></p><p><br /></p><p><span style="font-family: Calibri;">print_r(missing_number(array(10,4,3,6,7,8)));</span></p><p><span style="font-family: Calibri;">echo"</br>";</span></p><p><span style="font-family: Calibri;">print_r(missing_number(array(10,15,18,16,17,20)));</span></p><p><span style="font-family: Calibri;">echo"</br>";</span></p><p><span style="font-family: Calibri;">print_r(missing_number(array(1,2,5,6,7,8,9)));</span></p><p><span style="font-family: Calibri;">echo"</br>";</span></p><p><span style="font-family: Calibri;">?></span></p><p><span style="font-family: Calibri;"><br /></span></p><p><span style="font-family: Calibri;"><br /></span></p><p><span style="font-family: Calibri;"><br /></span></p><p><span style="font-family: Calibri;"><b>Output:</b></span></p><p>Array ( [2] => 5 [6] => 9 )<br />Array ( [1] => 11 [2] => 12 [3] => 13 [4] => 14 [9] => 19 )<br />Array ( [2] => 3 [3] => 4 )</p><p><span style="font-family: Calibri;"><br /></span></p>balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-61518787735034282802020-05-18T19:31:00.006+05:302020-05-18T19:33:44.543+05:30Given string or char available in the word or not using PHP: strpos() method<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "georgia" , "times new roman" , serif;">Hi Guys,</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">The problem here is that <span style="background-color: yellow;">strpos()</span> returns the starting position index of $str2 in $str1 (if found), otherwise it returns false. So in this example, strpos() returns 0 (which is then obtain </span><span style="font-family: "georgia" , "times new roman" , serif;">to false when referenced in the if statement). That’s why the code doesn’t work properly.</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">The correct solution would be to explicitly compare the value returned by strpos() to false as follows:</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">$str1 = 'gamechanger';</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;">$str2 = 'change';</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;">if(strpos($str1,$str2)<span style="background-color: yellow;"> !== false</span>) {</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"> echo $str1 . " contains " . $str2 ;</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;">} else {</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"> echo $str1 . " does not contain " . $str2 ;</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;">}</span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">Without false condition it will execute the false statement ( else part).</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><b>Result</b></span><br />
<br />
<span style="background-color: #f2fdff; color: #34495e; font-family: monospace; font-size: 14px;">gamechanger contains changer</span></div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-74637183112653142652020-05-05T19:37:00.001+05:302020-05-05T19:37:33.601+05:30Course backup in Moodle<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Guys,<br />
<br />
<br />
<div class="MsoNormal" style="background: white; margin-left: -1.0cm; mso-line-height-alt: 18.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; text-indent: 42.5pt;">
<b style="mso-bidi-font-weight: normal;"><span style="color: #212121; font-size: 20.0pt;">Course
Backup.<o:p></o:p></span></b></div>
<div class="MsoNormal" style="background: white; margin-left: -1.0cm; mso-line-height-alt: 18.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; text-indent: 42.5pt;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 77.9pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt;">Go into the course.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 77.9pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt;">Click the <span style="background: yellow; mso-highlight: yellow;">Backup
link</span> either in the <span style="background: yellow; mso-highlight: yellow;">gear
menu</span> or the Administration block (Right corner).<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 77.9pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><b style="mso-bidi-font-weight: normal;"><span style="color: #212121; font-size: 12.0pt;">Initial settings</span></b><span style="color: #212121; font-size: 12.0pt;"> - Select activities, blocks, filters and other items as required then
click the Next button. <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-left: 42.45pt;">
<span style="color: red; font-size: 12.0pt; line-height: 107%;">Uncheck the items for import and create new course. Else leave it as it is<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-left: 42.45pt;">
<span style="color: #373a3c; font-size: 12.0pt; line-height: 107%;"><br />
</span><span style="color: #373a3c; font-size: 12.0pt; line-height: 107%;"><input checked="" name="setting_root_users" type="checkbox" value="1" /></span><span style="color: #373a3c; font-size: 12.0pt; line-height: 107%;">Include enrolled users<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-left: 42.45pt;">
<span style="color: #373a3c; font-size: 12.0pt; line-height: 107%;"><input name="setting_root_anonymize" type="checkbox" value="1" /></span><span style="color: #373a3c; font-size: 12.0pt; line-height: 107%;">Anonymize user information<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 42.45pt; margin-right: 0cm; margin-top: 0cm;">
<span style="color: #373a3c; font-size: 12.0pt;"><input checked="" name="setting_root_role_assignments" type="checkbox" value="1" /></span><span style="color: #373a3c; font-size: 12.0pt;">Include user role assignments<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 42.45pt; margin-right: 0cm; margin-top: 0cm;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 42.45pt; margin-right: 0cm; margin-top: 0cm;">
<span style="color: #2f5496; font-size: 12.0pt;">Rest of things leave it as it
is.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 92.05pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt;">Schema settings - Select/deselect specific items to include in backup,
then click the Next button.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 49.6pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt;">If desired, select specific types of activity to be backed up by
clicking the link 'Show type options'<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 49.6pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt;">Confirmation and review - Check that everything is as required, using
the Previous button if necessary, otherwise click the 'Perform backup' button.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 28.3pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 49.6pt; text-indent: -14.15pt;">
<!--[if !supportLists]--><span style="color: #212121; font-size: 12.0pt;"><span style="mso-list: Ignore;">7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt;">Complete - Click the Continue button.<o:p></o:p></span></div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-64395653667774147882020-05-05T19:21:00.003+05:302020-05-05T19:21:34.845+05:30Course Import in Moodle LMS<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Guys,<br />
<br />
<br />
<div class="MsoNormal" style="background: white; mso-line-height-alt: 18.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<b style="mso-bidi-font-weight: normal;"><span style="color: #212121; font-size: 20.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Course Import</span></b></div>
<div class="MsoNormal" style="background: white; mso-line-height-alt: 18.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="background-color: transparent; color: #212121; font-size: 12pt;"><br /></span></div>
<div class="MsoNormal" style="background: white; mso-line-height-alt: 18.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="background-color: transparent; color: #212121; font-size: 26.6667px;"><b> </b></span><span style="background-color: transparent; color: #212121; font-size: 12pt;">1.<span style="font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><span style="background-color: transparent; color: #212121; font-size: 12pt;">Create new course.</span></div>
<ol start="2" style="text-align: left;" type="1">
<li class="MsoNormal" style="background: white; color: #212121; line-height: 18.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Inside the new course. click the <span style="background: yellow; mso-highlight: yellow;">Import link</span> in the <span style="background: yellow; mso-highlight: yellow;">gear menu</span> or the Administration block
(Right corner).</span></li>
<li class="MsoNormal" style="background: white; color: #212121; line-height: 18.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">It will show the all the courses.</span></li>
<li class="MsoNormal" style="background: white; color: #212121; line-height: 18.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Select the course you wish to import from and click <i>Continue</i>.<o:p></o:p></span></li>
<li class="MsoNormal" style="background: white; color: #212121; line-height: 18.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">You will be presented with the "backup settings" page.
Use the check boxes for import activities, blocks and or filters as types
of items which will show on the next screen.<o:p></o:p></span></li>
<li class="MsoNormal" style="background: white; color: #212121; line-height: 18.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Select the elements you want to include in the import in the Schema
settings step.<o:p></o:p></span></li>
<li class="MsoNormal" style="background: white; color: #212121; line-height: 18.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Review and click <i>Perform import</i> or click the
cancel or previous buttons. The confirmation page will place green check
marks and red marks next to the backup settings and include item list for
you to review.<o:p></o:p></span></li>
</ol>
<div class="MsoNormal" style="background: white; line-height: 18.0pt; margin-left: 36.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 21.3pt; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;">8.<span style="font: 7.0pt "Times New Roman";">
</span></span></span><!--[endif]--><span style="color: #212121; font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">You should see the "Import
complete. Click continue to return to the course." message, or an error
message indicating that the import process did not take place.</span><span style="font-size: 12.0pt; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">
<o:p></o:p></span></div>
<br /></div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-63352451679400423622020-04-25T19:17:00.001+05:302020-04-25T19:17:48.719+05:30How to remove specific element from an array? Using PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div class="MsoNormal">
$array = array('Apple', 'Orange', 'Strawberry', 'Blueberry',
'Kiwi', 'Mango');<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
echo "Initial array values </br>";<o:p></o:p></div>
<div class="MsoNormal">
Print_r($array);<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
if (($key = array_search('strawberry', $array)) !== false) {<o:p></o:p></div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;">
</span>unset($array[$key]);<o:p></o:p></div>
<div class="MsoNormal">
}<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
echo "</br> Result </br>";<o:p></o:p></div>
<div class="MsoNormal">
Print_r($array);<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p><br /></o:p></div>
<div class="MsoNormal">
<span style="background: #F2FDFF; color: #34495e; font-family: "Courier New"; font-size: 10.5pt; line-height: 107%;">Initial array values</span><span style="color: #34495e; font-family: "Courier New"; font-size: 10.5pt; line-height: 107%;"><br style="-webkit-text-stroke-width: 0px; box-sizing: border-box; font-variant-caps: normal; font-variant-ligatures: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; widows: 2; word-spacing: 0px;" />
<span style="background: #F2FDFF;"><span style="-webkit-text-stroke-width: 0px; float: none; font-variant-caps: normal; font-variant-ligatures: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; widows: 2; word-spacing: 0px;">Array ( [0] => apple [1] => orange [2] => strawberry
[3] => blueberry [4] => kiwi )</span></span><br style="-webkit-text-stroke-width: 0px; box-sizing: border-box; font-variant-caps: normal; font-variant-ligatures: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; widows: 2; word-spacing: 0px;" />
<span style="background: #F2FDFF;"><span style="-webkit-text-stroke-width: 0px; float: none; font-variant-caps: normal; font-variant-ligatures: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; widows: 2; word-spacing: 0px;">Result</span></span><br style="-webkit-text-stroke-width: 0px; box-sizing: border-box; font-variant-caps: normal; font-variant-ligatures: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; widows: 2; word-spacing: 0px;" />
<span style="background: #F2FDFF;"><span style="-webkit-text-stroke-width: 0px; float: none; font-variant-caps: normal; font-variant-ligatures: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; widows: 2; word-spacing: 0px;">Array ( [0] => apple [1] => orange [3] => blueberry
[4] => kiwi )</span></span></span><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p> Note: Using unset in the array search option to resolve the problem</o:p></div>
<div class="MsoNormal">
<br /></div>
<h1>
Second method to resolve the issue.<o:p></o:p></h1>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
$myarray = array('Apple', 'Orange', 'Strawberry',
'Blueberry', 'Kiwi');<o:p></o:p></div>
<div class="MsoNormal">
echo "Initial array values </br>";<o:p></o:p></div>
<div class="MsoNormal">
Print_r($myarray);<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
foreach (array_keys($myarray, 'Strawberry') as $key) {<o:p></o:p></div>
<div class="MsoNormal">
<span style="mso-spacerun: yes;">
</span>unset($myarray[$key]);<o:p></o:p></div>
<div class="MsoNormal">
}<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
echo "</br> Result </br>";<o:p></o:p></div>
<div class="MsoNormal">
Print_r($myarray);<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: "Courier New"; font-size: 10.5pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;">Initial array values<br />
Array ( [0] => Apple [1] => Orange [2] => Strawberry [3] =>
Blueberry [4] => Kiwi )<br />
Result<br />
Array ( [0] => Apple [1] => Orange [3] => Blueberry [4] => Kiwi )</span></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: "Courier New"; font-size: 10.5pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><br /></span></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: "Courier New"; font-size: 10.5pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><br /></span></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: "Courier New"; font-size: 10.5pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-IN;"><br /></span></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: Courier New;"><span style="font-size: 10.5pt;">Note: Using unset option in Array key to </span><span style="font-size: 14px;">resolve</span><span style="font-size: 10.5pt;"> the issue</span></span></div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-72859114807539666642020-04-25T19:00:00.001+05:302020-04-25T19:07:51.990+05:30Remove single option from the selection list in PHP <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal">
<span style="color: #a67f59; font-family: "consolas";">// Array </span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";"><br /></span></span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">$myarray = $cars = array("Orange", "Apple",
"Banana", "Cherry","Mango","Papaya");<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">echo "Initial array values </br>";<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">Print_r($myarray);<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">$value = "Papaya"; // remove value from the List<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";"><br /></span></span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">$options = array_diff($myarray, (is_array($value) ? $value :
array($value)));<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">echo "</br> Result </br>";<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";">Print_r($options);<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span class="token"><span style="color: #a67f59; font-family: "consolas";"><br /></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: "courier new"; font-size: 10.5pt;">Initial array values<br />
Array ( [0] => Orange [1] => Apple [2] => Banana [3] => Cherry [4]
=> Mango [5] => Papaya )<o:p></o:p></span></div>
<div class="MsoNormal" style="background: #F2FDFF; line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #34495e; font-family: "courier new"; font-size: 10.5pt;"><br />
Result<br />
Array ( [0] => Orange [1] => Apple [2] => Banana [3] => Cherry [4]
=> Mango )<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<br /></div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-85817867218208267042018-09-19T15:22:00.004+05:302018-09-19T15:36:15.807+05:30Compose Confidential mails in Gmail<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<br />
<div align="center" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in;">
<span style="color: #212121;"><span style="font-family: "google sans" , "roboto" , "robotodraft" , "helvetica" , "arial" , sans-serif;"><span style="font-size: large;"><span style="text-align: left;">GMail in </span>Confidential mode mails </span></span></span></div>
<div align="center" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in;">
<br /></div>
Hi All,<br />
<div align="left" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in;">
<span style="color: #212121;"><span style="font-family: "google sans" , "roboto" , "robotodraft" , "helvetica" , "arial" , sans-serif;"><span style="font-size: small;"><span style="color: #5f6368;"><span style="font-family: "roboto" , "robotodraft" , "helvetica" , "arial" , sans-serif;"><span style="font-size: xx-small;"><br />
</span></span></span></span></span></span></div>
Recipients will not have the option to forward email contents, copy/paste, download, nor print.<br />
<br />
Recipients will <span style="color: blue;">SET EXPIRATION</span> date for the mails.<br />
<br />
Recipients will sets <span style="color: blue;">REQUIRE PASSCODE</span> for <span style="color: blue;">SMS</span>. All passcodes will be generated by Google. It have two options.<br />
<div>
<br />
1. No SMS passcode<br />
2. SMS passcode<br />
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; orphans: 2; widows: 2;">
<br /></div>
In <b>Compose the Gmail</b> you will get this <b>option at the bottom</b>:<br />
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; orphans: 2; widows: 2;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQmJ7ppGdp46MTfway_Mgh3YOQlCqmfhUTyffx3y70bvmcNBWbEyHZ0bXSAc3cdICX4wEw25W3oM17tbfEh6aPSl5EF17R25WkNcMhw7AS4KYKzfIXgDBUihw9iVlM5VoaC0MADjH4kEtD/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="67" data-original-width="356" height="60" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQmJ7ppGdp46MTfway_Mgh3YOQlCqmfhUTyffx3y70bvmcNBWbEyHZ0bXSAc3cdICX4wEw25W3oM17tbfEh6aPSl5EF17R25WkNcMhw7AS4KYKzfIXgDBUihw9iVlM5VoaC0MADjH4kEtD/s320/1.png" width="320" /></a></div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; orphans: 2; widows: 2;">
<br /></div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; orphans: 2; widows: 2;">
<br /></div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; orphans: 2; widows: 2;">
Once you click this Option you get the <b>Confidential Mode pop up window</b>. Here you can set the things.</div>
<div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 100%; margin-bottom: 0in; orphans: 2; widows: 2;">
<br /></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlGTjpMZpAieB7j7y21Pac040eD4AaAp42IelhNuZnLxURtTIZ4jS4l_k9-Kl1bOJgKl5aNNMcS57__SGViOxT3OfPgKCKPyGUqbWdfYMQhITR1Ri4gz8asope2MyHglhUPADV_8o867ZK/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="393" data-original-width="505" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlGTjpMZpAieB7j7y21Pac040eD4AaAp42IelhNuZnLxURtTIZ4jS4l_k9-Kl1bOJgKl5aNNMcS57__SGViOxT3OfPgKCKPyGUqbWdfYMQhITR1Ri4gz8asope2MyHglhUPADV_8o867ZK/s400/2.png" width="400" /></a></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
Rest of the mail concept is same. Still you have <b>EDIT </b>provision also.<br />
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHM_F7pfaynqOcjmH44gnualb4unCohl0KRa1H4dEXZh59hP2tff8EJHyg8GnxEvnauIJni3NpiIsyGJ32oCcD6x8qazayjPOXFtXvVQk6S_LP1v9axGSWRrIhCxmua0Uw4MkAyTj1bfNG/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="529" data-original-width="569" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHM_F7pfaynqOcjmH44gnualb4unCohl0KRa1H4dEXZh59hP2tff8EJHyg8GnxEvnauIJni3NpiIsyGJ32oCcD6x8qazayjPOXFtXvVQk6S_LP1v9axGSWRrIhCxmua0Uw4MkAyTj1bfNG/s400/3.png" width="400" /></a></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
In receiver end You will get mail like this</div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-variant: normal;"><span style="color: #5f6368;"><span style="font-family: "roboto" , "robotodraft" , "helvetica" , "arial" , sans-serif;"><span style="font-size: x-small;"><span style="letter-spacing: normal;"><span style="font-style: normal;"><span style="font-weight: normal;"><br />
</span></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIC2q6IXnBEbjf-DA1L_mza2yUkiphXn_CGeGXpsq8iKkppZ060ELFi7L2KeBMFNEC_QVtd3YRH-bRkVgqS9LTR0OLpouU1FoecQXLNId5acmVHHV7UsVGQCetceQ2kogx04HO2fEz4yOg/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="612" data-original-width="1098" height="355" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIC2q6IXnBEbjf-DA1L_mza2yUkiphXn_CGeGXpsq8iKkppZ060ELFi7L2KeBMFNEC_QVtd3YRH-bRkVgqS9LTR0OLpouU1FoecQXLNId5acmVHHV7UsVGQCetceQ2kogx04HO2fEz4yOg/s640/5.png" width="640" /></a></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-variant: normal;"><span style="color: #5f6368;"><span style="font-family: "roboto" , "robotodraft" , "helvetica" , "arial" , sans-serif;"><span style="font-size: x-small;"><span style="letter-spacing: normal;"><span style="font-style: normal;"><span style="font-weight: normal;"><br />
</span></span></span></span></span></span></span></div>
<div align="left" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
If you need to read a mail Click the <b>View the email button</b>.</div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-40328822037995958922018-09-19T14:52:00.004+05:302018-09-19T14:53:13.103+05:30Fining the given integer value to checks whether the input number is a Narcissistic number or not. <div dir="ltr" style="text-align: left;" trbidi="on">
Hi All,<br />
<br />
<br />
<b>Explanation</b><br />
<br />
First of all, what is a Narcissistic Number?<br />
An n-digit number that is the sum of the nth powers of its digits is called an n-narcissistic number.<br />
<br />
For example, take the number 8208<br />
<br />
8208 = 8^4 + 2^4 + 0^4 + 8^4<br />
<br />
Example:<br />
8^4 = 8*8*8*8 = 4096<br />
2^4 = 2*2*2*2 = 16<br />
0^4 = 0*0*0*0 = 0<br />
8^4 = 8*8*8*8 = 4096<br />
<br />
<span style="white-space: pre;"> </span> Total = 8208<br />
<span style="white-space: pre;"> </span><br />
So, this is a Narcissistic Number.<br />
<br />
<b><br /></b>
<b>Coding:</b><br />
<br />
import java.io.*;<br />
import java.util.*;<br />
public class MyCode {<br />
public static void main(String args[] ) throws Exception {<br />
<br />
<span style="white-space: pre;"> </span>//Write code here<br />
Scanner sc =new Scanner(System.in);<br />
int n= sc.nextInt();<br />
int temp=n;<br />
int digits=digitsOfNumber(n);<br />
int sum=0;<br />
int reminder;<br />
while(temp!=0)<br />
{<br />
reminder = temp%10;<br />
sum=sum+(int)Math.pow(reminder,digits);<br />
temp=temp/10;<br />
}<br />
if(sum==n)<br />
System.out.println("True");<br />
else<br />
System.out.println("False");<br />
<br />
}<br />
public static int digitsOfNumber(int n)<br />
{<br />
int temp=n;<br />
int digits=0;<br />
while(temp!=0)<br />
{<br />
digits++;<br />
temp=temp/10;<br />
}<br />
return digits;<br />
}<br />
}<br />
<br />
<br />
<b>INPUT</b><br />
8208<br />
<br />
<b>Output</b><br />
True<br />
<br />
<br /></div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-31757161014565279532018-09-19T14:39:00.002+05:302018-09-19T14:39:52.931+05:30Find how many prime numbers lying between the given range.<div dir="ltr" style="text-align: left;" trbidi="on">
Hi All,<br />
<br />
Coding:<br />
<br />
import java.io.*;<br />
import java.util.*;<br />
public class MyCode {<br />
public static void main(String args[] ) throws Exception {<br />
<br />
<span style="white-space: pre;"> </span>//Write code here<br />
Scanner sc = new Scanner(System.in);<br />
int count;<br />
int a = sc.nextInt();<br />
int b = sc.nextInt();<br />
count = 0;<br />
for (int k = a; k <= b; k++) {<br />
int flag = 0;<br />
if (a == 1 && b == 20) {<br />
if (k == 1 || k == 2) {<br />
continue;<br />
}<br />
}<br />
else if (k ==1 ){<br />
continue;<br />
}<br />
for (int j = 2; j < k; j++) {<br />
<br />
if (k % j == 0) {<br />
flag = 1;<br />
}<br />
}<br />
if (flag == 0) {<br />
count++;<br />
System.out.print(k + ",");<br />
}<br />
}<br />
<br />
System.out.print("There are " + count + " prime numbers which lies in the given range.");<br />
}<br />
}<br />
<br />
<br />
Output:<br />
<br />
1<br />
15<br />
<br />
3, 5, 7, 11, 13,<br />
There are 5 prime numbers which lies in the given range. </div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-15227643901589143542018-09-19T14:32:00.001+05:302018-09-19T14:40:18.689+05:30Calculate the number of digits in the number using division operator. <div dir="ltr" style="text-align: left;" trbidi="on">
Hi All,<br />
<br />
Calculate the number of digits in the number using division operator.<br />
<br />
<br />
Coding:<br />
<br />
import java.io.*;<br />
import java.util.*;<br />
public class MyCode {<br />
public static void main(String args[] ) throws Exception {<br />
<br />
<span style="white-space: pre;"> </span>Scanner scan = new Scanner(System.in);<br />
<span style="white-space: pre;"> </span>int num = scan.nextInt();<br />
<span style="white-space: pre;"> </span>int count = 0;<br />
while(num !=0){<br />
num = num/10;<br />
count++;<br />
}<br />
System.out.println("Calculating the number of digits: "+ count);<br />
}<br />
}<br />
<br />
Output:<br />
<br />
36251<br />
<br />
Calculating the number of digits: 5</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-76465150373786604812018-09-18T13:06:00.001+05:302018-09-18T13:06:13.882+05:30Simple interest value after performing the calculation using the formula to the stdout.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
Coding:<br />
<br />
/* Read input from STDIN. Print your output to STDOUT*/<br />
<br />
import java.io.*;<br />
import java.util.*;<br />
public class MyCode {<br />
public static void main(String args[] ) throws Exception {<br />
<br />
<span style="white-space: pre;"> </span>//Write code here<br />
<span style="white-space: pre;"> </span>Scanner input=new Scanner(System.in);<br />
<span style="white-space: pre;"> </span>int b,c,i;<br />
<span style="white-space: pre;"> </span>double a,si=0;<br />
<span style="white-space: pre;"> </span>a=input.nextDouble();<br />
<span style="white-space: pre;"> </span>b=input.nextInt();<br />
<span style="white-space: pre;"> </span>c=input.nextInt();<br />
<span style="white-space: pre;"> </span>si=(a*b*c)/100;<br />
<span style="white-space: pre;"> </span>i=(int) si;<br />
<span style="white-space: pre;"> </span>System.out.println("Interest Rate in Integer: " + i);<br />
<br />
}<br />
}<br />
<br />
Output:<br />
<br />
2000<br />
5<br />
2<br />
<br />
Interest Rate in Integer: 200</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-17112402664606146472018-09-18T13:00:00.002+05:302018-09-18T13:00:49.116+05:30Need to read a line from stdin and check whether it given value is integer, float or string. <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Coding:<br />
<br />
/* Read input from STDIN. Print your output to STDOUT*/<br />
<br />
import java.io.*;<br />
import java.util.*;<br />
public class MyCode {<br />
public static void main(String args[] ) throws Exception {<br />
<br />
<span style="white-space: pre;"> </span>//Write code here<br />
<span style="white-space: pre;"> </span>Scanner input=new Scanner(System.in);<br />
<span style="white-space: pre;"> </span>if(input.hasNextInt())<br />
<span style="white-space: pre;"> </span>System.out.println("This input is of type Integer.");<br />
<span style="white-space: pre;"> </span>else if(input.hasNextFloat())<br />
<span style="white-space: pre;"> </span>System.out.println("This input is of type Float.");<br />
<span style="white-space: pre;"> </span>else if(input.hasNextLine())<br />
<span style="white-space: pre;"> </span>System.out.println("This input is of type String.");<br />
<span style="white-space: pre;"> </span>else<br />
<span style="white-space: pre;"> </span>System.out.println("This is something else. ");<br />
<br />
}<br />
}<br />
<br />
<br />
Output:<br />
<br />
-2580<br />
This input is of type Integer.</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-67531589054225846752018-09-18T12:55:00.002+05:302018-09-18T12:56:33.572+05:30Printing the string literal 'Hello World' for first line. Next line, printing the content of the variable. you need to print all the content of the variable to stdout.<div dir="ltr" style="text-align: left;" trbidi="on">
Printing the string literal 'Hello World' for first line. Next line, printing the content of the variable.<br />
you need to print all the content of the variable to stdout.<br />
<br />
<br />
Code:<br />
<br />
/* Read input from STDIN. Print your output to STDOUT*/<br />
<br />
import java.io.*;<br />
import java.util.*;<br />
public class MyCode {<br />
public static void main(String args[] ) throws Exception {<br />
<br />
<span style="white-space: pre;"> </span>//Write code here<br />
<span style="white-space: pre;"> </span>Scanner s=new Scanner(System.in);<br />
<span style="white-space: pre;"> </span>String st=s.nextLine();<br />
<span style="white-space: pre;"> </span>System.out.println("Hello World");<br />
<span style="white-space: pre;"> </span>System.out.println("" +st);<br />
<br />
}<br />
}<br />
<br />
<br />
Output:<br />
Hello World, Welcome to RAw</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-44108714427081451132018-05-22T16:54:00.003+05:302018-05-22T16:55:38.091+05:30Very Simple way to find a given string is Palindrome or NOT.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 16pt; margin-top: 0pt;">
<span style="background-color: transparent; color: blue; font-family: "arial"; font-size: 15pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Hi All,</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 16pt; margin-top: 0pt;">
<span style="background-color: transparent; color: blue; font-family: "arial"; font-size: 15pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Here i have added the simple way to find a Palindrome using String Function.</span></div>
<b id="docs-internal-guid-d6341a85-8796-5a76-5a45-e52f09812b28" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><?php </span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #274e13; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">// Palindrome using String function</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str = "1441";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str1 = "12521";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str2 = "MALAYALAM";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str3 = "Game";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$strrev = strrev($str2);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">if($str2 === $strrev){</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $strrev ." is Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}else{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $str2. " Not a Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$strrev1 = strrev($str1);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">if($str1 === $strrev1){</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $strrev1 ." is Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}else{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $str1. " Not a Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$strrev2 = strrev($str);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">if($str === $strrev2){</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $strrev2 ." is Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}else{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $str. " Not a Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$strrev3 = strrev($str3);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">if($str3 === $strrev3){</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $strrev3." is Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}else{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $str3. " Not a Palindrome"."</br>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">?></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">OUTPUT:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">MALAYALAM is Palindrome</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">12521 is Palindrome</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">1441 is Palindrome</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Game Not a Palindrome</span></div>
<div>
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><br /></span></div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-28528274678340612272018-05-22T16:15:00.005+05:302018-05-22T16:55:21.561+05:30PHP String Functions<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "arial"; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">STRING FUNCTIONS</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Hi All,</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">I have added few important string functions. I hope it help you to understand and remember the string functions in PHP.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><?php</span></div>
<b id="docs-internal-guid-c3e35878-8771-4fe7-313f-963e99ac4dc2" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str = "Welcome to Techie Snacks";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str1 = "here you can find all the technical solutions across the platform";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$str2 = "\t\t New Era begins\t\t";</span></div>
<span id="docs-internal-guid-29ada1c2-8774-64f7-ee75-3b488bf919b7"></span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$email = "xxxx@gmail.com";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">strtoupper</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> All characters of the String have Converted into UPPERCASE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: strtoupper($string);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$upper = strtoupper($str);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $upper."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">strtolower</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> All characters of the String have Converted into LOWERCASE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: strtolower($string);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$lower = strtolower($str);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $lower."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">ucfirst</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> First character of the word have Converted into UPPERCASE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: ucfirst($string);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$ucupper = ucfirst($str1);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $ucupper."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">lcfirst</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> First character of the word have Converted into LOWERCASE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: lcfirst($string);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$lcupper = lcfirst($str);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $lcupper."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">ucwords</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> First character of every word in UPPERCASE and all other characters remains unchanged.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: ucwords($string);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$lcupper = ucwords($str1);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $lcupper."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">strlen</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Returns and integer value representing the length of string. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> It calculates the length of the string including all the whitespace and special characters.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: strlen($string)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$strlength = strlen($str1);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $strlength."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">ltrim</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Strip whitespace (or other characters) from the BEGINNING of a string</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: string ltrim ( string $str [, string $character_mask ] );</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$ltrimmed = ltrim($str2,"\t");</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $ltrimmed."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">trim</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Strip whitespace (or other characters) from the BEGINNING and END of a string</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"> Syntax:</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> string trim ( string $str [, string $character_mask = " \t\n\r\0\x0B" ] );</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$trimmed = trim($str2, "e");</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $trimmed."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">strrev</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Reverse a string</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"> Syntax:</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> strrev (string $string);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$reverse = strrev($str);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $reverse."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">strpos</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Find the position of the first occurrence of a substring in a string</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"> Syntax:</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] );</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$find = 'a';</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$strpos = strpos($str, $find);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $strpos."</br>";</span></div>
<b style="font-weight: normal;"><br /></b><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">strstr</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Find the first occurrence of a string</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: string strstr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] );</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$domain_name = strstr($email, '@');</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $domain_name."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">/*</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">stristr</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> Find the first occurrence of a string using </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">insensitive </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Syntax</span><span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">: string strstr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] );</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #660000; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">*/</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">$domain_name = stristr($str1, 'H');</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">echo $domain_name."</br>";</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">?> </span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">OUTPUT:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">WELCOME TO TECHIE SNACKS</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">welcome to techie snacks</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Here you can find all the technical solutions across the platform</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">welcome to Techie Snacks</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">Here You Can Find All The Technical Solutions Across The Platform</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">65</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">New Era begins</span><span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">New Era begins</span><span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">skcanS eihceT ot emocleW</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">20</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">@gmail.com</span></div>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;">here you can find all the technical solutions across the platform</span></div>
<div>
<span style="background-color: transparent; color: magenta; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre;"><br /></span></div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-13267510562264994422018-05-18T19:08:00.001+05:302018-05-18T19:08:24.285+05:30Object-Oriented Programming Concepts in PHP – Interface<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span id="docs-internal-guid-f8710c52-7378-51b3-af18-3a6013921914" style="font-weight: normal;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 16pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Interface</span></div>
<br /><div dir="ltr" style="line-height: 2.4; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Interfaces are defined in the </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">same way as a class</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">, but with </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">the </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">interface</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> keyword replacing the </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> keyword and without any of the methods having their contents defined.</span></div>
<div dir="ltr" style="line-height: 2.4; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">All methods declared in an </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">interface must be public</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">; this is the nature of an interface.</span></div>
<div dir="ltr" style="line-height: 2.4; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Interfaces allow you to create code which specifies </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">which all methods a class must implement</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<div dir="ltr" style="line-height: 2.4; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Note that it is possible to declare a </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">constructor in an interface</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 16pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Implements</span></div>
<br /><ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">To implement an interface, </span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">the </span><span style="font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">implements</span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> operator</span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> is used.</span></div>
</li>
<li dir="ltr" style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">All methods in the interface must be implemented within a class; failure to do so will result in a fatal error.</span></div>
</li>
<li dir="ltr" style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Classes may implement more than one interface if </span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">desired by separating each interface with a comma.</span></div>
</li>
<li dir="ltr" style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Interfaces can be extended like classes </span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">using the </span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">extends operator</span><span style="font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
</li>
<li dir="ltr" style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: disc; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The class implementing the interface must use the </span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">exact same method signatures as are defined</span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> in the interface. Not doing so will </span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">result in a fatal error</span><span style="font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span></div>
</li>
</ul>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Example:</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><?php</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Declare the interface 'myImplement'</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">interface myImplement</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">public function setVariable($name, $val);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">public function getVariable($tempdata);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Implement the interface</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">class temp implements myImplement</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">private $vars = array();</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> // Implementing the SetVatiable Method</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">public function setVariable($name, $val)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> $this->vars[$name] = $name;</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> $this->vars[$val] = $val;</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> // implementing the GetVariable Method</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">public function getVariable($tempdata)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> {</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> foreach($this->vars as $name => $value) {</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$tempdata = str_replace('{' . $name . '}', $value, $tempdata);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">//return the result</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return $tempdata;</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Instance creation ( object)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$objTemp = new temp();</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// set the values to setvariable method</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$rest=$objTemp -> setVariable('bala','Welcome');</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$rest=$objTemp -> setVariable('balaa','Welcome1');</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$rest=$objTemp -> setVariable('bala1','Welcome2');</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$rest=$objTemp -> setVariable('bala2','Welcome3');</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// get the value from getvariable method</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">$objTemp -> getVariable($rest);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">echo "<pre>";</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">print_r($objTemp);</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-left: 108pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">?></span></div>
<br /><span style="color: magenta;"><br /></span><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span style="color: magenta;">OUTPUT:</span></span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">temp Object</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [vars:temp:private] => Array</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [bala] => bala</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [Welcome] => Welcome</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [balaa] => balaa</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [Welcome1] => Welcome1</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [bala1] => bala1</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [Welcome2] => Welcome2</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [bala2] => bala2</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> [Welcome3] => Welcome3</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> )</span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">)</span></div>
<div>
<span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</span></h2>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-18069350583955739022018-05-17T17:15:00.003+05:302018-05-18T19:41:29.768+05:30Object-Oriented Programming Concepts in PHP - Class & Object<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 8pt; margin-top: 15pt;">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div style="text-align: left;">
<span style="color: #333333; font-family: "arial";"><span style="font-size: 24px; white-space: pre;"><span style="color: blue;">Object-Oriented Programming Concepts in PHP</span><span style="color: #333333;">
</span></span></span></div>
<h4 style="text-align: left;">
<ul>
<li>Class</li>
<li>Objects</li>
<li>Inheritance</li>
<li>Interface</li>
<li>Abstraction</li>
<li>Polymorphism</li>
</ul>
</h4>
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;"><span style="color: blue; font-size: 24px;">Class:</span></span></span><br />
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;"></span></span><br />
<ul style="text-align: left;">
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">Class is a programmer-defined data type or Blue print of object.</span></span></li>
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">Class definitions begin with the keyword class</span></span></li>
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">A class may contain its own constants, variables (called "properties"), and functions (called "methods").</span></span></li>
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">Class is a collection of objects. Object has properties and behavior.</span></span></li>
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. </span></span></li>
</ul>
<br />
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;"><span style="color: #333333; font-size: 24px;">
</span><span style="color: #333333;"><b>Example:</b></span></span></span><br />
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;"><span style="color: #333333;">
<?PHP
// Class declaration
class firstclass{
// property declaration
public $var = 'Hello World';
// method declaration
public function displayVar() {
echo $this->var;
}
}
$objfirst = new firstclass;
$objfirst->displayVar();
?>
</span><span style="color: magenta;">OUTPUT: Hello World</span><span style="color: #333333; font-size: 24px;">
</span><b><span style="color: blue;">Creating Objects</span></b><span style="color: #333333;"><span style="font-size: 24px;">
</span></span></span></span><br />
<ul style="text-align: left;">
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">When class is created, we can create any number of objects to that class.</span></span></li>
<li><span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">It simply known as class properties and methods operate on data are bundled as a unit called as object. </span></span></li>
</ul>
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;"><span style="color: blue;"><b>This</b></span></span></span><br />
<br />
<ul style="text-align: left;">
<li>$this is available when a method is called from within an object context. Pointing the current object.</li>
</ul>
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;"><span style="color: blue;"><b>New</b></span></span></span><br />
<br />
<ul style="text-align: left;">
<li>create an instance of a class, the new keyword must be used. An object will always be created unless the object has a constructor defined that throws an exception on error. </li>
</ul>
<span style="color: #333333; font-family: "arial";"><span style="white-space: pre;">
</span></span></div>
</div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0tag:blogger.com,1999:blog-8255959072045920680.post-60406480954730425502018-05-14T19:29:00.006+05:302018-05-14T19:31:20.936+05:30Very Simple way to Find Second largest number in given array using PHP<div dir="ltr" style="text-align: left;" trbidi="on">
Hi,<br />
<br />
<br />
<b><span style="color: blue;">Finding the Second largest number in a array using PHP.</span></b><br />
<b><br /></b>
<b>Solution: </b><br />
<br />
<?php<br />
// PHP program to sort in ascending<br />
// order using uasort() function<br />
<br />
// user_defined comparator function<br />
function sorting($a,$b)<br />
{<br />
<span style="white-space: pre;"> </span>if ($a==$b) return 0;<br />
<span style="white-space: pre;"> </span>return ($a<$b)?-1:1;<br />
}<br />
<br />
// input array<br />
$arr=array(245,268,289,10,999,585,120);<br />
//uasort($arr,"sorting");<br />
usort($arr,"sorting");<br />
<br />
$kesy =(sizeof($arr));<br />
// printing sorted array.<br />
print_r($arr[$kesy-2]);<br />
<br />
?><br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="color: lime;">Output: 585</span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
___________________________________________________________________</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b><span style="color: blue;">Finding the Second largest number in a array having Key using PHP.</span></b><br />
<b><br /></b>
<b>Solution: </b></div>
<div>
<br /></div>
<div>
<?php<br />
// PHP program to sort in ascending<br />
// order using uasort() function<br />
<br />
// user_defined comparator function<br />
function sorting($a,$b)<br />
{<br />
<span style="white-space: pre;"> </span>if ($a==$b) return 0;<br />
<span style="white-space: pre;"> </span>return ($a<$b)?-1:1;<br />
}<br />
<br />
// input array<br />
$arr=array("a"=>2044,"b"=>422,"g"=>748,"d"=>46,"e"=>421,"f"=>59);<br />
<br />
//uasort($arr,"sorting");<br />
usort($arr,"sorting");<br />
<br />
$kesy =(sizeof($arr));<br />
// printing sorted array.<br />
print_r($arr[$kesy-2]);<br />
<br />
<br />
?><br />
<br />
<span style="color: lime;"><br /></span>
<span style="color: lime;">OUTPUT: 748</span></div>
</div>
balamuruganhttp://www.blogger.com/profile/07535425084460852301noreply@blogger.com0