aim25 Posted June 26, 2007 Share Posted June 26, 2007 I know i should know this, but what are the => and the -> used for? I tried google but to no avail did i find what i was looking for Quote Link to comment Share on other sites More sharing options...
corillo181 Posted June 26, 2007 Share Posted June 26, 2007 if you a noob you shouldn't be aim for that yet, it's use to build class and that's when you ready for O.O.P i haven't gone after it i'm still on functions. Quote Link to comment Share on other sites More sharing options...
per1os Posted June 26, 2007 Share Posted June 26, 2007 The => is used generally as part of an array which signifies "index" => "value"; The -> is used generally in OOP (Object Oriented Programming) $object->Property/Function to call a property or a function of that object. Quote Link to comment Share on other sites More sharing options...
Caesar Posted June 26, 2007 Share Posted June 26, 2007 You mean...? <?php $object->method($variable); ?> <?php $array = array('poop'=>'caca', 'pee'=>'urine'); ?> Look into OOP/Objects and arrays. But yeah, don't get ahead of yourself, start with the very basics. Will learn much much better. Quote Link to comment Share on other sites More sharing options...
Salis Posted June 26, 2007 Share Posted June 26, 2007 => Would be used in arrays For the => array_keys => array_values; And for the -> Class->Function <?php $old = array('Bob'=>'World'); $new = str_replace(array_keys($old), array_values($old), "Hello Bob"); echo $new ; ?> <?php class MySQL { fucntion MyQuery($str_query) { } } $SQL = new MySQL; $Res = $SQL->MyQuery("SELECT * FROM table"); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.