Jump to content

[SOLVED] Noob question...


aim25

Recommended Posts

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
Share on other sites

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
Share on other sites

=> 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.