How to slice a string in PHP?
问题 Ok, so I've got this string: "MICROSOFT CORP CIK#: 0000789019 (see all company filings)" And I would like to cut off everything after the "CORP" bit. How would I go about doing this in PHP? I am used to Python so I am not sure how this is done. To be clear, this is the output I want: "MICROSOFT CORP" I am trying: $companyname = substr($companyname, 0, strpos($companyname, " CIK")); and I am getting nothing showing. Here is my full code: <?php include 'simple_html_dom.php'; $html = file_get