Jump to content

insertion from for loop


zintani

Recommended Posts

Hello Guys,

With this code I am able to match two strings, where one of them is standard and the other is changeable. This doesn't matter. What it does matter that I want to insert the values into a database consisted of a number of columns. As you can see in the code every iteration it gives one value of the whole insertion.

I hope I made my question clear.

<?php
preg_match_all('/\b(' . implode("|", array_map("preg_quote", $dictionary)) . ')/i', $file, $foundwords);
$sim = array_count_values($foundwords[0]);
$max = max ($sim);
foreach ($sim as $key=> $value) {
$norm = ($value/$max);
echo $key. " = $norm </br>";
}
$foundwords[0] = array_flip ($foundwords[0]);
ksort($foundwords[0]);
foreach ($foundwords[0] as $key=> $value) {
echo "<br/>$key "; // [color=red]after here how can I insert all the values in one row[/color]
} 
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.