Created
January 16, 2012 02:50
-
-
Save MilkZoft/1618784 to your computer and use it in GitHub Desktop.
code.jobs - Word Count - PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wordCount($text) { | |
$words = explode(" ", $text); | |
return count($words); | |
} | |
$words = wordCount("Welcome to code.jobs"); | |
print $words; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment