HTML Special Characters in URL string [closed]

The best thing to do here is use the tools that WordPress has provided for you to construct your URLs.

In this solution you’re building an array of URL parameters with keys and values, then you’re “attaching” these parameters to the array using add_query_arg.

You can reuse this approach for all your URLs, and simply add/adjust your $parameters array as you need it, and the URL.

$parameters = [
    'event' => get_field( 'fl_name' ),
];

$final_url = add_query_arg( $parameters, site_url( '/enquiry/' ) );

then simply echo out your $final_url wherever you need it:

<a href="<?php echo $final_url; ?>">Make a request</a>

A one-liner version of all of this is:

<a href="<?php echo add_query_arg( [ 'event' => get_field( 'fl_name' ) ], site_url( '/enquiry/' ) ) ;?>">Make a request</a>

tech