Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prashant-shahi/focusvce-php

PHP Workshop by FocuSVCE(GLUG under FSMK) : Collection of PHP Question and their Answers.
https://github.com/prashant-shahi/focusvce-php

Last synced: 26 days ago
JSON representation

PHP Workshop by FocuSVCE(GLUG under FSMK) : Collection of PHP Question and their Answers.

Awesome Lists containing this project

README

        

# FOCUSVCE-php

This repository consists of the collection of solutions of the tasks given the PHP Workshop conducted by FOCUSVCE (GLUG under FSMK) at Sri Venkateswara College of Engineering(SVCE), Bangalore.

1) $color = array('white', 'green', 'red'') Write a PHP script which will display the colors in the following way :

Output : (Format - html)
white, green, red,

1. green
2. red
3. white
where 1,2,3 is a sorted list in HTML .

2) Write a PHP script to sort the following associative array :
array("Ram"=>"99","Abhinav"=>"141","Messi"=>"10","Ronaldo"=>"7") in
a) ascending order sort by value
b) ascending order sort by Key
c) descending order sorting by Value
d) descending order sorting by Key

3) Write a PHP script to calculate and display average temperature, five lowest and highest temperatures.
Recorded temperatures : 78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 75, 76, 73, 68, 62, 73, 72, 65, 74, 62, 62, 65, 64, 68, 73, 75, 79, 73
Expected Output :
Average Temperature is : 70.6
List of seven lowest temperatures : 60, 62, 63, 63, 64
List of seven highest temperatures : 76, 78, 79, 81, 85

4) Write a PHP script to get the shortest/longest string length from an array.
Sample arrays : ("abcd","abc","de","hjjj","g","wer")
Expected Output : The shortest array length is 1. The longest array length is 4.

5) Create a script that displays 1-2-3-4-5-6-7-8-9-10 on one line. There will be no hyphen(-) at starting and ending position.

6) Create a script to construct the following pattern, using a nested for loop.
```
*
* *
* * *
* * * *
* * * * *
* * * * *
* * * *
* * *
* *
*
```

7) Write a PHP program to print alphabet pattern 'A' USING LOOP.
Expected Output:

```
***
* *
* *
****
* *
* *
* *
* *
```

8) Write a function to calculate the factorial of a number (non-negative integer). The function accept the number as a argument

9) Write a function to reverse a string

10) Write a PHP function that checks if a string is all lower case

11) Write a PHP function that checks whether a passed string is palindrome or not?
A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam, LOL, 101.0

12) Write a PHP script to check if a string contains specific string?
Sample string : 'The quick brown fox jumps over the lazy dog.'
Check whether the said string contains the string 'jumps'.

13) Write a PHP script to generate simple random password [do not use rand() function] from a given string.
Sample string : '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz'
Note : Password length may be 6, 7, 8 etc.

14) Write a PHP script to print the next character of a specific character.
Sample character : 'a'
Expected Output : 'b'
Sample character : 'z'
Expected Output : 'a'

15) Write a PHP script to print letters from 'a' to 'z' using a Loop.
Expected Result : abcdefghijklmnopqrstuvwxyz