Toon posts:

[php] Aantal bepaalde caracters binnen een string

Pagina: 1
Acties:
  • 27 views sinds 30-01-2008

Verwijderd

Topicstarter
Hoi,

Ik ben op zoek naar een functie binnen php die het aantal caracters telt binnen een string.

Voorbeeld:

String1= Hallo
String2= hlolo
String3=Lo

Zoeken naar caracter l. En daar het aantal van:
Aantal l in string1 = 2
Aantal l in string2 = 2
Aantal l in string3 = 1

Graag reactie

Groetjes Willem

  • Swaptor
  • Registratie: Mei 2003
  • Laatst online: 15-10 19:25

Swaptor

Java Apprentice

Na wat kort zoekwerk in de php manual:

http://nl3.php.net/manual/en/function.substr-count.php

Ontdek mij!
Proud NGS member
Stats-mod & forum-dude


Verwijderd

Topicstarter
Hartstikke bedankt, ik had er idd overheen gekeken.

Groetjes

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

Juist, gewoon even in de manual kijken dus. :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Dit topic is gesloten.