[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 :wave:
edit*
How do i find the ascii of a string char?
Re: -> = and some other questions
I have no idea what you are talking about :confused:
-> is the object access operator and
=> is used to assign key names to arrays
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?
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());
Re: -> = and some other questions
Quote:
Originally Posted by |2eM!x
Also how do i find the ascii of a letter?
ord() should be what you're looking for.
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?
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?
Re: -> = and some other questions
The modulus operator is the percent sign:
'%'
Good luck;