AgerNic.com/ro
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
Tutorial

Tutorial PHP» PHP siruri de caractere - strings

Un ?ir este o secven?? de caractere, precum „Buna Romania!”.

Func?ii cu ?iruri PHP
În acest capitol vom analiza unele func?ii utilizate frecvent pentru manipularea ?irurilor.
strlen () - întoarce lungimea unei ?iruri
Func?ia PHP strlen () returneaz? lungimea unui ?ir.

Exemplu
Întoarce lungimea ?irului „Buna Romania!”:

<?php
echo strlen("Buna Romania!"); // output 13
?>

str_word_count () - Num?r? cuvinte într-o ?ir
Func?ia PHP str_word_count () num?r? num?rul de cuvinte dintr-un ?ir.

Exemplu
Afiseaza num?rul de cuvinte din ?irul „Buna Romania!”:

<?php
echo str_word_count("Buna Romania!"); // output 2
?>

strrev () - inverseaza un ?ir
Func?ia PHP strrev () inverseaz? un ?ir.
Exemplu
Inversa?i ?irul „Hello world!”:


<?php
echo strrev("Hello world!"); // outputs !dlrow olleH
?>
Tags: php siruri de caractere strings

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


analytics piwika