Jump to content

Archived

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

redarrow

php statement help cheers thank you.

Recommended Posts

Advance thank you.

I am learning php quite well know, but i need an example in the simplest way to exsplain the following php statements cheers.

ps. Thank you for your time all the ansaws will get studed tonight.


Example of statements dont understand and also need little examples cheers.


as // how do i use what can it do a small example please.

const // how do i use what can it do a small example please.

continue // how do i use what can it do a small example please.

declaire // how do i use what can it do a small example please.

default // how do i use what can it do a small example please.

do // how do i use what can it do a small example please.

eval // how do i use what can it do a small example please.

foreach // how do i use what can it do a small example please.

globel // how do i use what can it do a small example please.

new // how do i use what can it do a small example please.

use // how do i use what can it do a small example please.

var // how do i use what can it do a small example please.


Please can a user exsplain the statements in php and give detail and a example cheers.

Share this post


Link to post
Share on other sites
um, tried the manual? It explains most things and has examples.

PS - watch the spelling :)

Share this post


Link to post
Share on other sites
this works

[code]
<?php

$name=array("hi i am john");

foreach($name AS $message);

echo $message;

?>
[/code]


this dosent why there is no php information to use the AS statement ?
[code]
<?php

$name="john";

$name as $mess;

echo $mess;

?>
[/code]

Share this post


Link to post
Share on other sites
The AS operator is only valid within the foreach statement. The foreach statement can only be used to iterate arrays (and objects in PHP5).

Ken

Share this post


Link to post
Share on other sites
[!--quoteo(post=387658:date=Jun 25 2006, 04:13 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 25 2006, 04:13 AM) [snapback]387658[/snapback][/div][div class=\'quotemain\'][!--quotec--]
The AS operator is only valid within the foreach statement. The foreach statement can only be used to iterate arrays (and objects in PHP5).

Ken
[/quote]

Thank you kenrbnsn for your help cheers.

how to use DO and DEFULT

Share this post


Link to post
Share on other sites
[!--quoteo(post=387667:date=Jun 25 2006, 04:51 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 25 2006, 04:51 AM) [snapback]387667[/snapback][/div][div class=\'quotemain\'][!--quotec--]
rtfm!!!
[/quote]

you give me the link for

defult

do

i got meny books i can not find it ok cheers.

Share this post


Link to post
Share on other sites
default I used it at switch case.
[a href=\"http://sg.php.net/manual/en/control-structures.switch.php\" target=\"_blank\"]http://sg.php.net/manual/en/control-structures.switch.php[/a]

new is for class.
[a href=\"http://sg.php.net/manual/en/function.get-class.php\" target=\"_blank\"]http://sg.php.net/manual/en/function.get-class.php[/a]

Share this post


Link to post
Share on other sites
Do as in [a href=\"http://php.net/dowhile\" target=\"_blank\"]do-while[/a]. Once again I say RTFM!!!!!

Share this post


Link to post
Share on other sites
[!--quoteo(post=387714:date=Jun 25 2006, 04:23 AM:name=hackerkts)--][div class=\'quotetop\']QUOTE(hackerkts @ Jun 25 2006, 04:23 AM) [snapback]387714[/snapback][/div][div class=\'quotemain\'][!--quotec--]
What is RTFM ?
[/quote]


it stands for READ THE MANUAL

Share this post


Link to post
Share on other sites
Most of those keywords you have stated are reserved words. [a href=\"http://www.php.net/manual/en/reserved.php\" target=\"_blank\"]Click here[/a] to read up on them. It wont explain what each one does but it'll show where you use them.

Also any one that states RTFM agian will be given a warning instantly, If you want someone to read the manual point them to it.

Share this post


Link to post
Share on other sites
[quote]it stands for READ THE MANUAL[/quote]

Thanks for the explaination..

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.