Well, I've looked over PHP and I was more than happy to find it was much more powerful that ASP. I'm very familiar with the Linux OS but not very familiar with PHP. If this is a dumb question, I have to apologize because I've looked everywhere.

Here goes:

In VBScript you can select multiple cases for a variable like this (if you're unfamiliar with VBScript):


request.form("foo") // Pulls the variable from form field foo

select case foo

case "foo"

Response.write "You Entered Foo" //equal to php's print

case "bar"

response.write "You entered Bar"

case else

response.write "You entered something other than foo or bar"

end select


Is there a PHP equivalent to this? Thanks for any help you could provide - and if you happen to know a site for "ASP Converts" - don't be afraid to share it. :-)

    I believe the php equiv of 'select case' is 'switch'.

    in asp you might have something like this..

    select case str_form_action

    case "new"

    response.write "making a new record<BR>"

    new_record()

    case "old"

    response.write "loading an old record<BR>"

    old_record()

    case else

    response.write "I have no idea.."

    end select

    The same thing in php would be..

    switch($str_form_action)

    {

    case "new":
    
    	{
    	echo "making a new record<BR>";
                                old_record();
                                }
    
    
    	break;
    
    case "old":
    
    	{
    	echo " loading an old record<BR>";
                                old_record();
                                }
    
    
    	break;
    
    
                 default:
                             {
    
                              echo "i have no idea";
                              }

    }

    Hope that helps

      Write a Reply...