Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

experiment no 5 Web Application development Using PHP

a. Write a PHP program to calculate length of string and count number of words in a string without using string function b. Write a PHP program to demonstrate the use of built in string function.

Uploaded by

Mahesh Pokharkar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

experiment no 5 Web Application development Using PHP

a. Write a PHP program to calculate length of string and count number of words in a string without using string function b. Write a PHP program to demonstrate the use of built in string function.

Uploaded by

Mahesh Pokharkar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Web Application development Using PHP Experiment No.

EXPERIMENT No. 5
1.0 Title:
a. Write a PHP program to calculate length of string and count number of words in
a string without using string function
b. Write a PHP program to demonstrate the use of built in string function.
2.0 String concept:

It is sequence of characters enclosed within pair of single quotation marks


or double quotation mark.

3.0 New Concepts:


String Functions:
1. str_word_count(): count the number of words in the string
2. strlen(): return the length of string
3. strrev(): reverse a string
4. strops(): returns position of first occurrence of string
5. str_replace(): replaces some characters in a string
6. ucwords(): convert first character each word into uppercase
7. strtoupper(): convert string to uppercase letters
8. strtolower(): convert string to lowercase letters
9. strcmp(): compare two strings

Learning Objectives:

Intellectual Skills:
1. To understand the concept of string
2. To understand the use of functions of string

Motor Skills:
1. Ability to use string functions to solve problems
2. Ability to use PHP web servers.

4.0 Apparatus:

Srno Equipment Name with broad specification Practical

1 Hardware : any computer system (preferably i3 or i5) All

2 Operating System: Windows/Linux All

3 Any Database tool such as MYSQL,MariaDB 15,16

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.5

5.0 Observation:

a. Write a PHP program to calculate length of string and count number of words in
a string without using string function
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………

6.0 Questions for confirmation of learning:


Student shall write answers to the questions in laboratory independently.
They may use or refer to the notes etc. Teacher shall supervise.
1. PHPPHPPHPPHP. Which string function is used to get this type of
output. Write PHP program for it.

………………………………………………………………………………………………
………………………………………………………………………………………………
……………………….…….……………………………………………………………….
.……………………………………………………………………………………………..
………………………………………………………………………………………………

2 What are the uses of strlen() and strops()

………………………………………………………………………………………………
……………………….…….……………………………………………………………….
.……………………………………………………………………………………………..
………………………………………………………………………………………………
………………………………………………………………………………………………

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.5

7.0 Student Activity:


Teacher shall form two groups of students.
Each group shall perform only one allotted activity from the following.
Teacher shall supervise.
1. Write a program to implement the use of str_word_count()
2. Write a program to implement the use of strrev()
3. Write a program to implement the use of ucwords()
4. Write a program to implement the use of strtoupper(),strtolower()
9.0 Result

 Solved the problem based on string functions

(Space for Answers)

(Student shall attach separate sheet if needed)

………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
……………………………………………………………………………………………

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.5

………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
…………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
…………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
……………………………………………………………………

Marks 15 15 10 5 5 50 Dated
Signature
Obtained

Date: Signature

Maharashtra State Board of Technical Education

You might also like