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

php exp5 23

The document outlines a laboratory experiment for a web page development course using PHP, focusing on string manipulation tasks such as calculating string length and counting words without built-in functions. It includes practical questions about finding text within a string, converting text to title case, and examples of using PHP functions like strpos() and ucwords(). Additionally, it provides exercises on removing HTML tags and checking for palindromes in strings.

Uploaded by

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

php exp5 23

The document outlines a laboratory experiment for a web page development course using PHP, focusing on string manipulation tasks such as calculating string length and counting words without built-in functions. It includes practical questions about finding text within a string, converting text to title case, and examples of using PHP functions like strpos() and ucwords(). Additionally, it provides exercises on removing HTML tags and checking for palindromes in strings.

Uploaded by

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

DEPARTMENT OF COMPUTER ENGINEERING

Subject: web page development using php Subject Code: 22619


Semester: 6 Course: CO6I-A
Laboratory No: Name of Subject Teacher: Saqib Ghatte
Name of Student: AFIF IRFAN NAZIR Roll Id: 21203A1005

Experiment No: 5
Title of Experiment Write a PHP program to
a) Calculate length of string
b) Count the number of words in string- without using string functions

Practical related questions.


1. How to find text within a string?
In PHP, you can use the strpos() function to find the position of the first
occurrence of a text within a string.

2. How to convert text in lowercase into title case?


In PHP, you can use the ucwords() function to convert a lowercase string into
title case. This function returns a string with the first character of each word in
uppercase and the rest of the characters in lowercase

3. Write a script to find length of the string “Vidyalankar Polytechnic”?


Exercise

1. Write an example to remove HTML tags from a string in php?


Ans: Strip_tags() is function to remove HTML tag in the string.

2. Write a simple PHP program to demonstrate use of various built in string functions.

3. Write a script for given string is palindrome or not.

You might also like