|
-
Nov 16th, 2005, 05:36 PM
#1
Thread Starter
Admodistrator
[RESOLVED] -> = and some other questions
What does => do, and whats the difference from that an =?
Also, how come i cant just do:
$response-> getit();
but i have to do
$stuff = $response-> getit();
or else it $stuff will just return 'object'?
Thanks 
edit*
How do i find the ascii of a string char?
Last edited by |2eM!x; Nov 16th, 2005 at 07:15 PM.
-
Nov 17th, 2005, 01:15 AM
#2
Re: -> = and some other questions
I have no idea what you are talking about 
-> is the object access operator and
=> is used to assign key names to arrays
-
Nov 17th, 2005, 04:37 PM
#3
Thread Starter
Admodistrator
Re: -> = and some other questions
Okay, I have some source and it uses an include file where there are functions..i cant just use the functions like normal, i have to use => and i dont know why..
Also how do i find the ascii of a letter?
-
Nov 17th, 2005, 04:56 PM
#4
Re: -> = and some other questions
Do you mean -> ?? You never access functions using =>
Like I said in my previous post, -> is the object access operator. Its the equivilent of a . in VB and is used to access object members.
VB Code:
Dim myObj As new MyObject
Print myObject.property;
Print myObject.memberFunction;
The same in PHP would be:
PHP Code:
$myObj = new MyObj;
echo($myObj->property);
echo($myObj->memberFunction());
-
Nov 17th, 2005, 04:59 PM
#5
Lively Member
Re: -> = and some other questions
 Originally Posted by |2eM!x
Also how do i find the ascii of a letter?
ord() should be what you're looking for.
-
Nov 17th, 2005, 06:22 PM
#6
Thread Starter
Admodistrator
Re: -> = and some other questions
visual yeah your right, -> is what im using. I now understand what the thing does, and thanks yak for the ord thing.
Also one more question:
Is there a mod operator? Something that will tell me if one number is divisible by another?
-
Nov 17th, 2005, 06:46 PM
#7
Thread Starter
Admodistrator
Re: -> = and some other questions
found it bcmod
okay, lemme see if i got this right, to see if a number is divisble by like 4 you do
PHP Code:
if (bcmod('8','4') == '0'){
am i right?
-
Nov 17th, 2005, 07:39 PM
#8
Lively Member
Re: -> = and some other questions
The modulus operator is the percent sign:
'%'
Good luck;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|