Toon posts:

[PHP] If, en dan checken op 1e 4 karakters

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

Verwijderd

Topicstarter
Heb hier al gezocht maar kan dat niet vinden.
Ik heb nu dit

if ($record->achternaam == "Jansen" $color = "#FF0000" ; else $color = "#CCCCCC";

Nu wil ik dat er alleen gekeken word of de 1e 4 karakters (jans) overeenkomen.
Is dit mogelijk?

  • Sjeik
  • Registratie: Augustus 2001
  • Laatst online: 26-11-2025
Ja zeker, kijk hier eens naar:
http://nl3.php.net/manual/nl/function.substr.php

Was ik maar rijk en niet zo knap...


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 22-01 23:51

NMe

Quia Ego Sic Dico.

En dat had je ook prima zelf kunnen vinden met een beetje logisch Googlen. ;)
[google=php string functions]

'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.