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 8429725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:24:57+00:00 2026-06-10T05:24:57+00:00

I have this in PHP $string=Thisissomekindofstringiwantthislolipop; I want new string like this $string=iwantthis; But

  • 0

I have this in PHP

$string="Thisissomekindofstringiwantthislolipop";

I want new string like this

$string="iwantthis";

But i have more string similar

$string1="Thisissomekindofstrigqqqqqqqqqkokiki";

And new string

 $string1="qqqqqqqqq";

The value of letters at beggining is always the same, and i always need new string with same letters count, is posible to do that?

Txanks in advance

  • 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-10T05:24:59+00:00Added an answer on June 10, 2026 at 5:24 am

    If you want to cut the string you should take a look on substr.
    You can then cut the unneeded parts:

    <?php
    $string="Thisissomekindofstringiwantthislolipop";
    echo substr($string, 22, 9); // returns 'iwantthis'
    ?>
    

    Update because of your comment:

    You can also split a string by a delimiter (here: with explode). E.g.

    <?php
    $string = "vimeo.com/24076588";
    $parts = explode("/", $string);
    echo $parts[1]; // prints 24076588
    ?>
    

    Or even nicer. Just extracting the numeric id from the URL with a regular expression using preg_match_all:

    <?php
    $string = "http://vimeo.com/24076588";
    preg_match_all('/[\d]+/i',$string, $result); 
    print_r($result);  
    ?>
    

    This prints out

    Array
    (
        [0] => Array
            (
                [0] => 24076588
            )
    
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this string in php i want to skip the ppattern ------------------------------------------ FROM:Andy;
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
Excuse the terrible question title. I have this PHP string and want to check
I have a PHP String like this: $string = 'a => 1 , b
I have a weird problem. I have checking a php string like this: On
I have this string: $string = 'foo bar php haystack needle' And i want
I have this string a:10,b:xx,e:20,m:xy,w:30,z:50 But, the keys and the value change... I want
In PHP i have this string variable: $var = 00480722 ZF452D041502 13 9900 153370178;
i have a string like this one: $string = some text http://dvz.local/index/index/regionId/28 http://stuff.kiev.ua/roadmap_page.php http://192.168.3.192/roadmap_page.php
Let's say in PHP I have a string-variable : This takes between 5 and

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.