Dizesinden PHP Filtre

1 Cevap php

Ben örneğin PHP bir dize var $string = "Blabla [word]";

I would like to filter the word between the '[' brackets. The result should be like this $substring = "word";

teşekkürler

1 Cevap

Deneyin:

preg_match ('/\[(.*)\]$/', $string, $matches);
$substring = $matches[1];

var_dump ($substring);