» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2006, 12:18 PM
planner planner is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
planner is on a distinguished road
Default how I assign $doc to array

$doc = (hello this is a test);

how I assign $doc to array

Reply -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 07-22-2006, 12:20 PM
dexter dexter is offline
OSP Starters
 
Join Date: Jun 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dexter is on a distinguished road
Default

PHP Code:
$doc = "hello, this is a test";

$array["something"] = $doc; -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #3  
Old 07-22-2006, 12:21 PM
furious furious is offline
OSP Starters
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
furious is on a distinguished road
Arrow

Planner

PHP Code:
$my_array = array();

$my_array[] = $doc;

Bye
furious -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #4  
Old 07-22-2006, 12:24 PM
kingfisher kingfisher is offline
OSP Starters
 
Join Date: Jun 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
kingfisher is on a distinguished road
Default related question

Hi folks

related question

I just want to print each single word with this $my_array[0]; it print whole text. HOW???? -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #5  
Old 07-22-2006, 12:27 PM
yoyo yoyo is offline
OSP Starters
 
Join Date: Apr 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
yoyo is on a distinguished road
Default

KINGFISHER
HERE's YOUR "RELATED" ANSWER

PHP Code:
$my_array = array();
$my_array[] = 'hello';
$my_array[] = 'this';
$my_array[] = 'is';
// etc....

// or
$my_array = array('hello', 'this', 'is');


// then to print
echo $my_array[0];
echo $my_array[1];
echo $my_array[2];

// or use a foreach loop
foreach ($my_array as $value) {
echo $value;
}

// or use a for loop
for ($i = 0; $i < count($my_array); $i++) {
echo $my_array[$i];
} -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
way to merge Hash (Array) dynamically? benaud PHP Programming and Tips 2 08-11-2006 02:21 PM
Welcome to array on OutSourcingPlans... osp Introductions 0 07-18-2006 03:22 PM
Unable to Assign in an Array !! jackky PHP Programming and Tips 1 12-09-2005 06:03 AM
Length of Array kelli ASP forums and Tips 1 12-08-2005 08:49 AM
Counting Values in Array johny PHP Programming and Tips 1 12-07-2005 08:00 AM


All times are GMT. The time now is 10:32 PM.