- substr: documentation ( source)
- strpos: documentation ( source)
<?php
$test_str = "Mit #[a]http://www.shakin-cats.de/[@]Shakin' Cats[/a]";
$band_start_pos = strpos( $test_str, '#' ); // erstes Zeichen # $row['beschreibung']
if ( $band_start_pos !== FALSE ) {
echo "[".$test_str."]<br>";
echo "band_start_pos=[".$band_start_pos."]<br>";
$band_end_pos = strpos( $test_str, '#', $band_start_pos +1 ); // zweites Zeichen #
if ( $band_end_pos !== FALSE ) {
echo "band_end_pos=[".$band_end_pos."]<br>";
$band_name = substr( $test_str, $band_start_pos +1, $band_end_pos - $band_start_pos +1 );
echo "[".$band_name."]<br>";
}
}