예제 #1
0
<?php

function booksBYAuthorYear($tempAuthorName, $tempYear = 1910)
{
    echo $tempYear;
    echo "<br />";
    echo $tempAuthorName;
    echo "<br />";
}
$year = 1920;
$authorName = "William Shakespeare";
booksByAuthorYear($authorName);
예제 #2
0
<body>
   
    <?php 
//Strings
$quote = "Courage is resistance to fear, mastery of fear, not absence of fear";
$replaced = str_replace("fear", "pain", $quote, $count);
echo $count;
echo $replaced;
echo strpos($quote, "fear", 26);
//Functions
function booksByAuthorYear($tempAuthorName, $tempYear = 1910)
{
    echo "\n";
    echo $tempAuthorName;
    echo "\n";
    echo $tempYear;
}
function getAuthor()
{
    return "Charles Dickens";
}
$year = 1920;
$authorName = getAuthor();
echo $authorName;
echo booksByAuthorYear("Ruben Dario");
?>
    

</body>
</html>
예제 #3
0
<?php

function booksBYAuthorYear($tempAuthorName, $tempYear = 1910)
{
    echo $tempYear;
    echo "<br />";
    echo $tempAuthorName;
    echo "<br />";
}
function getAuthor()
{
    return "Charles Dickens";
}
$year = 1920;
$authorName = getAuthor();
booksByAuthorYear($authorName, $year);