Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列から部分文字列を取得しようとしています: これを説明する最良の方法は、次の例です。
$string = 'locations?city=London'; if (strpos($string,'city=') !== false) { // now here I need something to get London in a string }
parse_str( parse_url( 'locations?city=London', PHP_URL_QUERY ), $params ); print_r( $params ); // outputs: Array ( [city] => London ) echo $params['city']; // outputs London