How to convert a string to an array in php

0 votes

I want to convert a string into an array in PHP 

$str="this is string";

The output should  be like this:

  arr[0]=this
  arr[1]=is
  arr[2]=string 

I want to convert the string after whitespace in an array.

Jun 1, 2022 in PHP by Kichu
• 19,050 points
237 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

How to convert an array to a string in PHP?

What can I do to get the ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,050 points
392 views
0 votes
1 answer

How to convert a string to JSON object in PHP?

Hello @kartik, it seems that your JSON is ...READ MORE

answered Oct 20, 2020 in PHP by Niroj
• 82,880 points
4,975 views
0 votes
1 answer

How to check if a string is an email address in PHP?

Hello, Try this without regular expressions: <?php ...READ MORE

answered Nov 3, 2020 in PHP by Niroj
• 82,880 points
3,081 views
0 votes
1 answer

How do I convert a string to a number in PHP?

You don't have to do this, since ...READ MORE

answered Feb 23, 2022 in PHP by Aditya
• 7,680 points
385 views
0 votes
0 answers

How to convert an array to object in PHP?

How can I convert an array like ...READ MORE

Jun 18, 2022 in PHP by narikkadan
• 63,420 points
297 views
0 votes
0 answers

How to sort an array of associative arrays by value of a given key in PHP?

Given this array: $inventory = array( ...READ MORE

Jul 24, 2022 in PHP by Kithuzzz
• 38,010 points
401 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
1,147 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
10,903 views
0 votes
1 answer

Failure uploading Image on AmazonS3 with PHP SDK

Try this, I took it out from ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,670 points
3,679 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,670 points
1,455 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP