Rouven: strpos und String abschneiden

Beitrag lesen

Hello,

$str = "Sony Vaio VGN-BX394VP Core 2 Duo T5500 2x 1.66GHz • 1024MB • 80GB • DVD+/-RW DL • Intel GMA950 onboard Grafik max.12...";
$sony_int_start = strpos($str, 'VGN-');
$sony_int_end = strpos($str, ' ') - $sony_int_start;

nutze den zweiten Parameter von strpos.

substr($str, $sony_int_start, $sony_int_end)

Rouven

--
-------------------
Ambition is the last refuge of failure.  --  Oscar Wilde (Irish Poet, Novelist, Dramatist and Critic, 1854-1900)