Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:15:36+00:00 2026-06-18T06:15:36+00:00

I wrote a function to strip parameters from urls, the function looks like this

  • 0

I wrote a function to strip parameters from urls, the function looks like this

function remove_it($c_link){

        $regex = array();
        $award = array();

        $regex[] = '/[\?&](?<name>sa)=(?<value>[^&=]+)/';
        $regex[] = '/[\?&](?<name>ei)=(?<value>[^&=]+)/';
        $regex[] = '/[\?&](?<name>ved)=(?<value>[^&=]+)/';
        $regex[] = '/[\?&](?<name>usg)=(?<value>[^&=]+)/';

        foreach($regex as $remove){

            $c_link = preg_replace($remove,'',$c_link);

        }

        return $c_link;

    }

When I use a testurl like this

$test = 'http://forum.gofeminin.de/forum/dietetique/__f2955_dietetique-Diatpillen.html&sa=U&ei=8doOUa6HOsfKtAaDpICIBQ&ved=0CB0QFjAA&usg=AFQjCNEcFS48QvteNkSNcszXv5RG6VUe2g';

It’s woking perfect. Now I wanted to use it in my code. So I called to function with my data and it doesn’t affect the string. I used print_r to see if the string looks strange, but it’s just 1:1 like in $test

$TEST-> http://forum.gofeminin.de/forum/dietetique/__f2955_dietetique-Diatpillen.html&sa=U&ei=C9wOUZuvCoeQtQavpoHoDg&ved=0CB0QFjAA&usg=AFQjCNHkRBKRpZXZX7idJ6YmSG0AIxtOdw
print_r-> http://forum.gofeminin.de/forum/dietetique/__f2955_dietetique-Diatpillen.html&sa=U&ei=C9wOUZuvCoeQtQavpoHoDg&ved=0CB0QFjAA&usg=AFQjCNHkRBKRpZXZX7idJ6YmSG0AIxtOdw

As I used all debugging methods that I know of, I don’t really know where I should start searching… any pointers ?

I made antoher testrun, and saved all data in an array, later on I wanted to stript the parameter for 1 url. Here the testcode:

    echo '<pre>';
    print_r($test).'</br>';
    echo remove_it($test[0]);
    echo '</pre>';
    break;

the output was like :

Array
(
    [0] => http://forum.gofeminin.de/forum/dietetique/__f2955_dietetique-Diatpillen.html&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CDUQFjAA&usg=AFQjCNGgMS-nHM2JY_PkIt7C_RT2dr9bUw
    [1] => http://www.fitforfun.de/abnehmen/gesund-essen/diaetpillen/diaetpillen-appetitzuegler_aid_2100.html&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CEEQFjAB&usg=AFQjCNG60KJy3wLR8DnLm9gKQEn-uR6l3w
    [2] => http://www.stern.de/ernaehrung/uebergewicht-abnehmen/diaetpillen-check-welche-mittel-machen-duenn-das-abc-der-schlankmacher-615772.html&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CEYQFjAC&usg=AFQjCNGLzi5UMG4g5INDkeBdMpENgY4gHg
    [3] => http://getslim.de/diaetpillen-im-test&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CEoQFjAD&usg=AFQjCNEcZnpSlVVxLgskK9DfhBF9AHGC2w
    [4] => http://www.br.de/fernsehen/bayerisches-fernsehen/sendungen/gesundheit/themenuebersicht/medizin/schlankheitspillen-diaet-tabletten100.html&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CFQQFjAE&usg=AFQjCNHujKjdfNsOkarYf6MwHCPODcISjw
    [5] => http://www.diaetpillenvergleich.de/beste-diatpillen/&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CFoQFjAF&usg=AFQjCNFBgbYjgutHJfp-eQztXTsKYk7rTw
    [6] => http://www.diaetpillen-online.de/&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CF4QFjAG&usg=AFQjCNF083onO0rkMuQjY0tEIhhdSM4Igg
    [7] => http://diaet.erdbeerlounge.de/Diaetpillen/&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CGIQFjAH&usg=AFQjCNFhNr-gsFxK1-vfjhnC1A5qQi1ZjQ
    [8] => http://diaet.erdbeerlounge.de/abnehmen-forum/Diaetpillen-_t2698848s1&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CGcQFjAI&usg=AFQjCNHhHY3zUnJtwF6-HV-DbsxaVUFxsg
    [9] => http://www.gutefrage.net/tag/diaetpillen/1&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CG0QFjAJ&usg=AFQjCNHPYODXZA1Sa2rs6ItnUWTOYkJj3w
)
http://forum.gofeminin.de/forum/dietetique/__f2955_dietetique-Diatpillen.html&sa=U&ei=LOIOUaqQGITntQbmmIHYBQ&ved=0CDUQFjAA&usg=AFQjCNGgMS-nHM2JY_PkIt7C_RT2dr9bUw
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:15:38+00:00Added an answer on June 18, 2026 at 6:15 am

    I made the test array and it works for me. It seems that your code is fine and something else is wrong.

    Try wrapping the function input in double quotes.

    remove_it("$test[0]");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this really simple c++ function I wrote myself. It should just strip
I wrote a function in Java to fetch 10 links by their IDs from
I wrote this function to make columns sortable. I want to rearrange divs based
I wrote this function for filling closed loop, pixvali is declared globally to store
I wrote this function to get the unread count of google reader items. function
I wrote this function to get a pseudo random float between 0 .. 1
I am trying to write a VB function to strip unwanted characters from a
I wrote a function that gives me the length of a dynamic array by
I'm refactoring some code that a friend wrote and recently stumbled across this function:
I wrote function onclick of a element <div class=left_collapsed>Որոնում</div> <div class=container style=display: none;> <ul>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.