str_word_count ==> gjen sa fjal ka stringu funksioni strpos() ==> gjen nese nje tekst specifik ndodhet perg : Notes">

NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

strlen ==> gjen gjatesin e stringut keshtu
<?php
$a = "Hello";
echo strlen(string $a);
?>

str_word_count ==> gjen sa fjal ka stringu
<?php
$a = "Hello";
echo str_word_count (string $a);
?>
funksioni strpos() ==> gjen nese nje tekst specifik ndodhet pergjat stringut.
Rezultati: True ose false.

<?php
$host = "Server Host clientx date:20.01.2023";

//emerFunksioni (arg1, arg2);

var_dump (strpos($host, 'e', 2));
?>
rezultati: 4 sepse rezultati nis nga indexi 2
offset ==> nga do nisi kerkimi.
___________________________________
str_replace() ==> perdoret per te zvendesuar nje fjal me nje fjal tjt.

<?php
$host = "Server Host clientx date:20.01.2023";

$host = str_replace('Host', 'Hosts', $host);
echo $host;
?>
mund te pranoj edhe me shume se nje replace ne nje kohe
<?php
$host = "Server Host clientx date:20.01.2023";


$host = str_replace(['Host','clientx'],['Hosts',''], $host);
echo $host;
?>

______________________
strtolower() ==> kthen karakteret ne shkronja te vogla.
strtoupper() ==> kthen karakteret ne shkronja te medha.
echo $host. '<br>' . strtolower($host) . '<br>' . strtoupper($host) . '<br>';
rezultati: Server Hosts date:20.01.2023
server hosts date:20.01.2023
SERVER HOSTS DATE:20.01.2023
__________
sintaksa e funksionit
emerFunksioni () {

}
ka dy lloje argumentesh te detyrushme dhe opsionale
_________________
<?php

$a= 5;

function emerFunksioni (){
$a = 1;
echo "Test" . '<br>';
return $a;
}
echo emerFunksioni() . '<br>';
echo $a;

?>
Rezultati: Test , 1 ,5.
____________________
nese nje argumenti i deklarohet nje vler fillestare quhet argument opsional
argumentat e detyrushem duhet te perdoren me sezben
argumentat opsional jo

________________
<!DOCTYPE html>
<html>
<body>

<?php

$a= 5;
$b = 7;

function emerFunksioni (string $a,int $b,bool $c = true) :int { ==> : int ne fund e detyrojn funksionin te kthej nje intiger.

return 1 ;
}
echo emerFunksioni("Test", $a, 6);


?>

</body>
</html>

_______________________________________________
---------------------------------------------------------------------------Funksionet Rekursive.------------------------------------------------------
Funksionet rekursive jan ato funksione qe therrasin vet veten deri ne momentin qe plotsohet kushti

<?php

$a = 5;

function faktorialRec($a) :int {

if ($a==1){
return 1 ;
}

return $a * faktorialRec($a - 1);

}

echo faktorialRec($a);
?>
Rezultati : 120 sepse 5*4*3*2*1 = 120


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.