Jump to content

PHP Function List


otuatail

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.