Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I've just started learning php and I have to solve the practice questions in the text book! Practice questions: I need to make a function

I've just started learning php and I have to solve the practice questions in the text book!

Practice questions:

  • I need to make a function that uses pi () value as a global variable in my program to print the area of the circle. And then I need to make a form to input the radius from the user and display the area to the user.

  • Input a string of size divisible by 2 from the user. Then I need to make a function to convert this string into an associative array, where every odd character in the string is a key and the even character is its corresponding value.

  • I need to make a form in HTML that lets the user upload a file. So I need a PHP script to open the text file and print all the data in it.

  • I need to make a program to use session variables and start a session. In this part, I have to use $_SESSION['views'] to count page views. The question says the number should increment each time the user reloads/reopens the page.

  • I need to make a function that takes 1 float number, multiplies it by 9 and returns an integer value to the caller. By using the default value for the function argument as 5.2.

  • I need to explain the difference between local and global variables in PHP. For this question, I need to explain it with an example!

  • I need to explain why is PHP considered a loosely typed language.

  • I need to explain what are type declarations in PHP and how they are useful with an example.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions