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 Link to comment https://forums.phpfreaks.com/topic/57307-solved-noob-question/ 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. Link to comment https://forums.phpfreaks.com/topic/57307-solved-noob-question/#findComment-283293 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. Link to comment https://forums.phpfreaks.com/topic/57307-solved-noob-question/#findComment-283294 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. Link to comment https://forums.phpfreaks.com/topic/57307-solved-noob-question/#findComment-283299 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"); ?> Link to comment https://forums.phpfreaks.com/topic/57307-solved-noob-question/#findComment-283303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.