I want to explode this string
$string = "WATER VALVE COMPLETE (5 PORT) Company: (US) Pools & Spas - SCP Manufacturer: CARETAKER C|O COVER POOLS INC Product Number: CTK-20-8609 Manufacturer Part #: 5-9-2000 U/M: EA Description: Caretaker 5-Port Water Valve, Complete";

$e = explode($string, "Company");

But not working, I want the part before Company:

I dont understand why its not working can anyone help

Member Avatar for diafol

You can use explode I suppose:

$bits = explode(' Company:', $string);
$product = $bits[0];

Or you can use strpos() and substr()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.