admin管理员组

文章数量:1313076

I would like a script that changes the final number I have in my slug by +1, for example if my link is https://site. com/permalink-1 number 1 must become 2, so I would like to insert a list of posts to change the permalink like that:

   $old_url = array(
        'http://localhost:8888/site/permalink-1/',
        'http://localhost:8888/site/permalink-1/',
        'http://localhost:8888/site/permalink-5/',
        'http://localhost:8888/site/permalink-37/',

    );

then he has to give me this as a result:

   $new_url = array(
        'http://localhost:8888/site/permalink-2/',
        'http://localhost:8888/site/permalink-2/',
        'http://localhost:8888/site/permalink-6/',
        'http://localhost:8888/site/permalink-38/',

    );

once the permalink has changed it should automatically update the post permalinks. i'm not that good at php code, could you help me? thanks :)

本文标签: permalinksphp script to change slug in post automatically