Jump to content

Archived

This topic is now archived and is closed to further replies.

otuatail

PHP Function List

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.