Hi everyone

Forgive me if I am asking a foolish thing, i have seen several time this sign "->" in php.

example is below

$total_report = round($rows->turnover_cost_annual);

It is bold here "ound($rows->turno" can anyone please let me know how it is pronounced and whats its use in php. Any usefull tutorial on this?

Thanks in advance.

the arrow sign "->" is used to reference objects from its function/methods and properties

Member Avatar for rajarajan2017
Array ( [0] => 10 [1] => 20 [2] => 30 [3] => 40 ) 100

do you aware of above? The above is also used for the reference to the value within the array index.

while($row  = mysql_fetch_object($result)) { 
        echo "<tr>"; 
        echo "<td>".$row->id."</td>"; 
        echo "<td>".$row->country."</td>"; 
        echo "<td>".$row->animal."</td>"; 
        echo "</tr>"; 
    }

The above code from the database the field values were displayed here $row is the reference to that id.

These symbols sometimes be called as POINTERS

Array ( [0] => 10 [1] => 20 [2] => 30 [3] => 40 ) 100

do you aware of above? The above is also used for the reference to the value within the array index.

while($row  = mysql_fetch_object($result)) { 
        echo "<tr>"; 
        echo "<td>".$row->id."</td>"; 
        echo "<td>".$row->country."</td>"; 
        echo "<td>".$row->animal."</td>"; 
        echo "</tr>"; 
    }

The above code from the database the field values were displayed here $row is the reference to that id.

These symbols sometimes be called as POINTERS

Thanks for being detailed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.