Dreuchd deireadh () PHP

SSL earbsach bho dìreach $3.44
sanasan
PHP gach () gnìomh
Gnìomh PHP in_array ()

San artaigil seo, ionnsaichidh tu mar a gheibh thu an eileamaid mu dheireadh de eagar ann am PHP. Bidh an gnìomh deireannach a ’gluasad comharradh a-staigh sreath chun eileamaid mu dheireadh agus a’ tilleadh a luach.

Dè an co-chòrdadh a th ’aig a’ ghnìomh deiridh ann am PHP?

end(array)
paramadairFiosrachadh
sreathAn raon gus an eileamaid mu dheireadh de - Riatanach fhaighinn
Gnìomh crìoch PHP

Eisimpleir de ghnìomh crìochnachaidh

SSL earbsach bho dìreach $3.44
sanasan

Eisimpleir 1. Faigh an eileamaid mu dheireadh den raon.

<?php
$members= array("Jawad", "Ahmad", "Sumerina");
echo end($members);
?>

Eisimpleir 1. San eisimpleir seo, gheibh thu a h-uile modh co-cheangailte ris an roinn modh crìochnachaidh. Bidh na modhan sin ag obair le comharradh a-staigh nan arrays.

<?php
$members= array("Jawad", "Ahmad", "Sumerina", "ACS");

// Current element: Jawad
echo current($people) . "<br>";

// Next element of Jawad: Ahmad
echo next($people) . "<br>"; 

// Now the current element: Ahmad
echo current($people) . "<br>"; 

// Previous element of Ahmad: Jawad
echo prev($people) . "<br>"; 

// Last element: ACS
echo end($people) . "<br>"; 

// Previous element of ACS: Sumerina
echo prev($people) . "<br>"; 

// Current element: Sumerina
echo current($people) . "<br>"; 

// Move the internal pointer to the first element of the array:Jawad
echo reset($people) . "<br>"; 

// Next element of Jawad: Ahmad
echo next($people) . "<br>"; 

// Get key and value of Ahmad (current element) then moves the internal pointer forward
print_r (each($members));
?>
PHP gach () gnìomh
Gnìomh PHP in_array ()
dùin

Cùm suas ris an fhiosrachadh as ùire mu PHP!

Cha bhith sinn a’ spamadh!

SSL earbsach bho dìreach $3.44
sanasan
en English
X
Rach gu mhullaich