Connecting...

This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to PHP
For more information, please see full course syllabus of Introduction to PHP
Introduction to PHP User-Defined Functions
Lecture Description
In this lesson our instructor talks about user-defined function. First, he discusses defining functions, function parameters, and return statements. Then he talks about where to define functions, include_once construct, and reasons to use functions. He also lectures on version 10.0 of the web application development, outputting HTML in functions, and some coding conventions. He ends the lesson with a helpful homework challenge.
Bookmark & Share
Embed
Share this knowledge with your friends!
Copy & Paste this embed code into your website’s HTML
Please ensure that your website editor is in text mode when you paste the code.(In Wordpress, the mode button is on the top right corner.)
×
Since this lesson is not free, only the preview will appear on your website.
- - Allow users to view the embedded video in full-size.
Next Lecture
Previous Lecture
3 answers
Last reply by: Russell Burnham
Thu May 16, 2013 7:14 PM
Post by Russell Burnham on April 18, 2013
Matthew, I can't get the return to work, here is my code:
"<?php
function testrr($num){
if ($num == 1){
return 'one';
}
elseif ($num == 2){
return 'two';
}
}
testrr(1);
?>"
This always returns blank.
Am I doing something wrong?
Please help.