otuatail Posted May 17, 2006 Share Posted May 17, 2006 I have been looking for a refernce type of all the functions available in php. I want to iterate through a string and as PHP is C based, Thought of something like $char = $mystring[$x];I also need to construct a Select Case:Any help on this please. I might be new to PHP but have used C and C++ extensivly.Desmond. Link to comment https://forums.phpfreaks.com/topic/9849-php-function-list/ Share on other sites More sharing options...
zq29 Posted May 17, 2006 Share Posted May 17, 2006 There is a function reference over at php.net.As for iterating through a string, you have the right idea - Just to expand on it though...[code]<?php$str = "The quick brown fox jumped over the lazy dog";for($i=0; $i<strlen($str); $i++) { echo $str[$i]."<br/>";}?>[/code] The above will go through the whole of $str and print each character on a new line...[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I also need to construct a Select Case:[/quote] I don't understand what you mean, care to elaborate?[b]EDIT:[/b] I just done a search on Google for Select Case, and it appears that its equivilent in PHP is the switch statement, used like this:[code]<?php$number = 1;switch($number) { case 0: echo "Number is zero"; break; case 1: echo "Number is one"; break; default : echo "Number is not zero or one";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/9849-php-function-list/#findComment-36577 Share on other sites More sharing options...
samshel Posted May 17, 2006 Share Posted May 17, 2006 Strings[a href=\"http://in.php.net/manual/en/ref.strings.php\" target=\"_blank\"]http://in.php.net/manual/en/ref.strings.php[/a]Select case : it is similar to C.hth Link to comment https://forums.phpfreaks.com/topic/9849-php-function-list/#findComment-36583 Share on other sites More sharing options...
otuatail Posted May 17, 2006 Author Share Posted May 17, 2006 Thanks for the help that works fine now. Is there a comprehensive list of functions on this site or any other for all functions like int strcmp(str , str) Desmond. Link to comment https://forums.phpfreaks.com/topic/9849-php-function-list/#findComment-36617 Share on other sites More sharing options...
obsidian Posted May 17, 2006 Share Posted May 17, 2006 [!--quoteo(post=374670:date=May 17 2006, 10:55 AM:name=otuatail)--][div class=\'quotetop\']QUOTE(otuatail @ May 17 2006, 10:55 AM) [snapback]374670[/snapback][/div][div class=\'quotemain\'][!--quotec--]Thanks for the help that works fine now. Is there a comprehensive list of functions on this site or any other for all functions like int strcmp(str , str) Desmond.[/quote]did you look at the [a href=\"http://in.php.net/manual/en/ref.strings.php\" target=\"_blank\"]manual page[/a] linked above? scroll down the page just a little bit, and there is a comprehensive list of all string functions. plus, each links to the API for easy incorporation.also, once you go to a string function API page, if you look in the left column, a full listing of all associated functions is updated there. Link to comment https://forums.phpfreaks.com/topic/9849-php-function-list/#findComment-36620 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.