Search Results

Search found 410 results on 17 pages for 'explode'.

Page 1/17 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • PHP Explode and Get_Url: Not Showing up the URL

    - by elmaso
    hello! its a little bit hard to understand. in the header.php i have this code: <? $ID = $link; $url = downloadLink($ID); ?> I get the ID with this Variable $link -- 12345678 and with $url i get the full link from the functions.php in the functions.php i have this snippet function downloadlink ($d_id) { $res = @get_url ('' . 'http://www.example.com/' . $d_id . '/go.html'); $re = explode ('<iframe', $res); $re = explode ('src="', $re[1]); $re = explode ('"', $re[1]); $url = $re[0]; return $url; } and normally it prints the url out.. but, i cant understand the code..

    Read the article

  • Replace use of explode() with str_split()

    - by user289346
    $transData = fgets($fp); while (!feof ($fp)) { $transArry = explode(" ", $transData); $first = $transArry[0]; $last = $transArry[1]; $Sub = $transArry[2]; $Grade= $transArry[3]; echo "<table width='400' ><colgroup span='1' width='35%' /><colgroup span='2' width='20%' /> <tr><td> ".$first." ".$last." </td><td> ".$Sub." </td><td> ".$Grade." </td></tr></table>"; $transData = fgets($fp); } My teacher wants me to change this use of explode() to str_split() while keeping the same output. How do I do this?

    Read the article

  • PHP something faster than explode to get filename from URL

    - by FFish
    My URL's can be absolute or relative: $rel = "date/album/001.jpg"; $abs = "http://www.site.com/date/album/image.jpg"; function getFilename($url) { $imgName = explode("/", $url); $imgName = $imgName[count($imgName) - 1]; echo $imgName; } There must be a faster way to do this right? Maybe a reg expression? But that's Chinese to me..

    Read the article

  • PHP explode not filling in array spot 0

    - by Billy Winterhouse
    I have a file we will call info.txt under UNIX format that has only the following in it: #Dogs #Cats #Birds #Rabbits and am running this against it: $filename = "info.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd,filesize ($filename)); fclose ($fd); $delimiter = "#"; $insideContent = explode($delimiter, $contents); Now everything looks to be working fine except when I display the array I get the following. [0] => [1] => Dogs [2] => Cats [3] => Birds [4] => Rabbits I checked the .txt file to make sure there wasn't any space or hidden characters in front of the first # so I'm at a loss of why this is happening other than I feel like I'm missing something terribly simple. Any ideas? Thanks in advanced!

    Read the article

  • PHP Explode with an Unicode character as separator

    - by Young Roger
    XPDFs pdftotext converts pdf to text and outputs it at command line level. If needed it inserts PageBreaks between the pages as specified in TextOutputDev.cc: eopLen = uMap->mapUnicode(0x0c, eop, sizeof(eop)); This Unicode symbol is encoding independent, -enc ASCII7 wouldn't change it. I'm currently willing to use PHP for converting and splitting the PDF file into several TXT pages for database storage. However, the following function does work, but takes twice as long as a conversion of the whole book in one time. for($i = 1; $i <= $pages[0]; $i++) $page[$i] = shell_exec('/usr/bin/pdftotext sample.pdf -f '.$i.' -l '.$i.' -'); How am I supposed to explode(0x0c, $wholePDF) with an Unicode character as separator? Currently, page[$i] doesn't seem to retrieve those weird Unicode PageBreak characters from the shell_exec(). I tried several headers for encoding (UTF-8 especially) but it didn't work out so far.

    Read the article

  • Turn RSS into array, explode the 'description' and insert words into MySQL table one per row

    - by K.I
    I have only recently gotten into php and MySQL and I want to take an RSS feed, turn it into an array, take only the description part of the XML, explode it and insert it into a table on a MySQL base. I feel like this should be possible, but is a little over my head right now. I tried using magpie as a parser, but if possible I want to do it in simpler php code. The result I am looking for would take a description "This is a cat" and insert it into a table with two fields ID term 1 This 2 is 3 a 4 cat I've been stumped on this for a couple days. Any help would be great.

    Read the article

  • PHP explode and set to empty string the missing pieces

    - by Marco Demaio
    What's the best way to accomplish the following. I have strings in this format: $s1 = "name1|type1"; //(pipe is the separator) $s2 = "name2|type2"; $s3 = "name3"; //(in some of them type can be missing) Let's assume namen/typen are strings and they can not contain a pipe. Since I need to exctract the name/type separetly, I do: $temp = explode($s1, '|'); $name = $temp[0]; $type = ( isset($temp[1]) ? $temp[1] : '' ); Is there an easier (smarter whatever faster) way to do this without having to do isset($temp[1]) or count($temp). Thanks!

    Read the article

  • Explode URL Query String Issue

    - by Ian McAbee
    PHP newbie here.. I am trying to create a function where the user is redirected back to the previous page after adding an item to their cart. However, when they are redirected back with the code below it leaves a duplicate of the directory (ie. example.com/catalog/garden-tools/garden-tools function custom_add_to_cart_redirect() { $_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); $url = explode('/', rtrim($_SERVER['REQUEST_URI_PATH'], '/')); return $url[3]; } A print_r reveals the following: Array ( [0] => [1] => thefarmshop [2] => catalog [3] => garden-tools [4] => gardening-glove ) What could the issue be?

    Read the article

  • PHP Explode: How to Download and Split a Specific HTML Part?

    - by elmaso
    Hello, example: at this domain http://www.example.com/234234/go.html is only one iframe-code how can i get the url in the iframe-code? go.html: <iframe style="width: 99%;height:80%;margin:0 auto;border:1px solid grey;" src="i want this url" scrolling="auto" id="iframe_content"></iframe> i have this snippet, but its very bad coded.. function downloadlink ($d_id) { $res = @get_url ('' . 'http://www.example.com/' . $d_id . '/go.html'); $re = explode ('<iframe', $res); $re = explode ('src="', $re[1]); $re = explode ('"', $re[1]); $url = $re[0]; return $url; } thank you!

    Read the article

  • Gnome 3 and compiz, everything works except Explode and Leaf Spread animations

    - by Erik
    I am using 11.10 with Gnome 3, I have installed Compiz, and have got it functioning almost how I want it. I want my windows to Leaf Spread, which seems to work fine for a few minutes after I enable it and restart my machine. However, over the time of a few window closes, I notice that the objects are not showing up little by little until the Leaf Spread just doesn't show at all? This really isn't a big deal, but I'd like things to work properly. Can anyone shed some light on this?

    Read the article

  • Explode all folders

    - by sam
    Ive got a folder with about a hundred sub folders and again each ones of those has between 10 and 20 sub folders, so all in all a pretty large folder tree. Is there a simple way i can explode or export all of the files in the tree to a new folder which will just be one folder contain the files (no folders, no trees). Im running OSX 10.8, although ive also got Parallels so if there is a windows solution i could just run that as its not something i need to do everyday.

    Read the article

  • Why did my graphics card explode?

    - by C-dizzle
    How did my graphics card "explode" like it did in the picture I have here? And if I was just plugging into my on-board graphics, why wouldn't the PC boot up like it normally would? It wouldn't come up until I opened the cover and removed the card, that's when I found it like this. EDIT: If the card was trying to still operate like this for a while, did it run the risk of damaging the PCI-E slot?

    Read the article

  • Check variable if explode-able in PHP

    - by ZaneDeFazio
    Not sure if there is a way to check a variable if it is explode-able or not... I have a database of city names some are one word cities and some are multiple word cities EX: Chicago, Los Angeles I keep getting an error when use "implode" when a city name is one word, so I tried using "count" and using an if statement... not having any luck $citi = explode(' ', $row['city']); $count = count($citi); if ($count > 1) { $city = implode('+', $citi); } else { $city = $citi; }

    Read the article

  • php explode() delimiter issue

    - by mumis2012
    I am new to php so this may be a simple fix. I have a text file named 'textt.txt' that looks like this: South East asia,2222,code1 winter break,3333,code2 my php code looks like this: <?php $x = file_get_contents('textt.txt'); $y = explode("\r\n", $x); $z = $y[0]; echo $z; ?> the outcome of this is: South East asia,2222,code1 I would like it to return only: South East Asia. How can I make this happen? Thanks!

    Read the article

  • explode is not working to split string

    - by pmms
    we unable to split the string following code.please Help us. <?php $i=0; $myFile = "testFile.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "no\t"; fwrite($fh, $stringData); $stringData = "username \t"; fwrite($fh, $stringData); $stringData ="password \t"; fwrite ($fh,$stringData); $newline ="\r\n"; fwrite ($fh,$newline); $stringData1 = "1\t"; fwrite($fh, $stringData1); $stringData1 = "srinivas \t"; fwrite($fh, $stringData1); $stringData1 ="malayappa \t"; fwrite ($fh,$stringData1); fclose($fh); ?> $fh = fopen("testFile.txt", "r"); $ while (!feof($fh)) { $line = fgets($fh); echo $line; } fclose($fh); $Beatles = array('pmm','malayappa','sreenivas','PHP'); for($i=0;$i<count($Beatles);$i++) { if($i==2) { echo $Beatles[$i-1]; echo $Beatles[$i-2]; } } $pass_ar=array(); $fh = fopen("testFile.txt", "r"); while (!feof($fh)) { $line = fgets($fh); echo $line; $t1=explode(" ",$line); print_r($t1); array_push($pass_ar,t1); } fclose($fh); Thanks & Regards pmms

    Read the article

  • Exploding by Array of Delimiters

    - by JoeC
    Is there any way to explode() using an array of delimiters? PHP Manual: array explode ( string $delimiter , string $string [, int $limit ] ) Instead of using string $delimiter is there any way to use array $delimiter without affecting performance too much?

    Read the article

  • PHP output of foreach loop into a new array.

    - by RobHardgood
    I know I'm probably missing something easy, but I have a foreach loop and I'm trying to modify the values of the first array, and output a new array with the modifications as the new values. Basically I'm starting with an array: 0 = A:B 1 = B:C 2 = C:D And I'm using explode() to strip out the :'s and second letters, so I want to be left with an array: 0 = A 1 = B 2 = C The explode() part of my function works fine, but I only seem to get single string outputs. A, B, and C.

    Read the article

  • Cocoa NSString explode

    - by dododedodonl
    Hi all, I have a NSString: @"1a,1b,1c,1d,5c". I want this NSString separated into a NSMutableArray, but I don't know how. I think it is fairly simple but I can't find it (maybe because my English isn't good enough to find a good description for it to search on). Regards, Dodo

    Read the article

  • convert following string into array using explode()

    - by Deepali
    HI, I have a string: NEW ALPINESTAR?S SMX PLUS WHITE MOTORCYCLE BOOTS! 44/9.5$349.95 Time Left 1h 2m NEW AGV BLADE FLAT MATTE WHITE LARGE/LG HELMET$75.53Time Left 1h 2m I want result in array like this: Productname Price time NEW ALPINESTAR?S SMX PLUS WHITE MOTORCYCLE BOOTS! 44/9.5 $349.95 Time Left 1h 2m

    Read the article

  • Make an array of two.

    - by marharépa
    Hello! I'd like to make an array which tells my site's pages where to show in PHP. In $sor["site_id"] i've got two or four chars-lenght strings. example: 23, 42, 13, 1 In my other array (called to $pages_show) i want to give all the site_ids to an other id. $parancs="SELECT * FROM pages ORDER BY id"; $eredmeny=mysql_query($parancs) or die("Hibás SQL:".$parancs); while($sor=mysql_fetch_array($eredmeny)) { $pages[]=array( "id"=>$sor["id"], "name"=>$sor["name"], "title"=>$sor["title"], "description"=>$sor["description"], "keywords"=>$sor["keywords"] ); // this makes my pages array with the information about that page. $shower = explode(", ",$sor["site_id"]); // this is explode my site_id $pages_show[]=array( "id"=>$sor["id"], "where"=>$shower //to 'where' i want to put all the explode's elements one-by-one, to get the result like down ); This script gives me the following result: Array (3) 0 => Array (2) id => "29" where => Array (2) 0 => "17" 1 => "16" 1 => Array (2) id => "30" where => Array (1) 0 => "17" 2 => Array (2) id => "31" where => Array (1) 0 => "17" But in this case I'd like to be this: Array (4) 0 => Array (2) id => "29" where => "17" 1 => Array (2) id => "29" where => "16" 2 => Array (2) id => "30" where => "17" 3 => Array (2) id => "31" where => "17" Thanks for your help.

    Read the article

  • Exploding a String In PHP

    - by streetparade
    How do i explode this string '||25||34||73||94||116||128' i need to have a array like this array ( 0 => '25', 1 => '34', 2 => '73', 3 => '94', 4 => '116', 5 => '128' ) explode("||", $array); didnt work for me i get this array array ( 0 => '', 1 => '25', 2 => '34', 3 => '73', 4 => '94', 5 => '116', 6 => '128', )

    Read the article

  • How to merge data using php.

    - by bob
    Currently my MySQL data stored like below product | total ------------------------------------------ puma,adidas | 100.00,125.00 puma | 80.00 reebok,adidas,puma | 70.00,100.00,125.00 adidas,umbro | 125.00,56.00 How to combine, explode, merge and total it like this in php? puma 485.00 adidas 350.00 reebook 70.00 umbro 56.00

    Read the article

  • Explore a COM Object in PHP

    - by shaiss
    What would be the proper way to explode a COM object for debugging? I have a 3rd party function that returns a multilevel object. The documentation is non existant, so I'd like to be able to echo everything out of the object or debug it in Komodo IDE. Komodo just says Object and nothing else. Maybe convert to array? I know some of the existing options such as $com->Status, but there are more variables returned that I'd like to know what they are.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >