Re: SIMPLE QUESTION
| From: | philip | Date: | Thu, 26 Oct 2000 01:23:22 +0000 |
| Subject: | Re: SIMPLE QUESTION | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21989@lists.php.net to get a copy of this message | ||
i've seen this question posted here a few times so i will write many
words, perhaps they will be of use.
<?
if ($name == 'John') {
// if name is john then do stuff
// that is in here like if you wanted
// to call a function then do so
johnnyboy();
// or if you want to define a function
// then do so
function wusup() {
print 'Hi John! wus up!!!';
}
// all the while this stuff only gets
// touched when $name is John otherwise
// it's all skipped over.
} // the end.
?>
is this what you mean? i don't have any programming background so perhaps
you are meaning something else. like i think you might mean 'if name
equals john then jump to somewhere else in the code' but idk how to
specify that action :-)
btw, by saying :
if ($name = "John") {
^
ut oh
you are actually defining $name to be John so it will ALWAYS be John, you
do not want to do this i don't think. use '==' instead.
regards,
philip olson
--
be outside the box.
On Tue, 24 Oct 2000, King Georgie wrote:
> I know this is a simple question to all u PHP gurus so here it is:
>
> Whats the PHP expression to jump to another subroutine???
> E.g.
>
> if ($name = "John") {
> JUMP_TO_SUB_JOHN // Line 2
> }
>
> function john () {
>
> }
>
> Whats the code on line 2?????
>
> THANKS
>
> ********************
> LaughingShop.com
> _____________________________
> Pictures, Videos, Sounds and Files...
> All there to make you laugh
> _____________________________
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>