How to combine 2 php functions into one function with a custom field

I had the same problem.

echo substr( $custom_field, 0, -6 );
echo str_replace(' ', '', $custom_field);

I think I solved it this way.

echo substr( str_replace(' ', '', $custom_field), 0, -6 );

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedueduseduedusedusedueduedus