Jump to content

Dale_G

Members
  • Posts

    74
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dale_G's Achievements

Member

Member (2/5)

0

Reputation

  1. Alright, thank all three of you for a job well done!
  2. Not having much luck with array_filter, and gevans after trying your code after a print_r I get Array ( [0] => A )
  3. Say I have this array $aych = array( 'B', 'B', 'A', 'A', 'B', 'A', 'A', 'B', 'B', 'A' ); and when i do a print_r right now i get... Array ( [0] => B [1] => B [2] => A [3] => A [4] => B [5] => A [6] => A [7] => B [8] => B [9] => A ) now what i need to happen is, loop through ALL keys in the array and check if there values are B, if they are, then remove it from the array and shift everything forward. foreach ( $aych as $key => $value ) { if ( preg_match( '{B}', $value ) ) { array_splice( $aych, $value, 0 ); } } i was able to loop through them all, and check if the value is B, as shown above. I know you use the array_splice function for this, but im not exactly sure how to properly utilize this in this environment. in the end, if i print_r it, i need to get Array ( [0] => A [1] => A [2] => A [3] => A [4] => A ) which is after all of the B's are removed and the array moved foward. does anyone know how to do this?
  4. Oops, I meant like where everything shifts over afterwards, so its as if it was never there and $maybe[3] could still be called, it would just be "xxxxxx" now. Basically, delete one item from an array, and shift everything over so all the keys are preserved. Sorry!
  5. hey, i was wondering if its possible to delete an item from an array? $maybe = array( 'xx', 'xxx', 'x', 'abc', 'xxxxxx' ); How could I remove "abc" ($maybe[3]) from the array entirely so that the array would now look something like this: $maybe = array( 'xx', 'xxx', 'x', 'xxxxxx' );
  6. String = 'hello!howare!yo!u?'; Look for the first occurrence of x, which in this case is '!', and then return the first section prior to x, which in this case would be 'hello'. How would that be done?
  7. You know that made ALOT of sense, thank you. Oh but, as far as that proxy method goes, still possible right? If so, how?
  8. Hey there. I'm using cURL to retrieve the contents of a page, this page, happens to echo out the IP Address, via echo '<b>IP:</b> '.$_SERVER['REMOTE_ADDR']; Now, I was able to successfully change, and set both the referer AND the user agent, to anything. Is this possible with the IP Address as well? Basically, how can I have it so when I try to request the page that echos out the IP address, it echos out something I, not the server, designates, such as '11.111.111.111' for example, if it's even possible. Thanks!
  9. Hello there, just a quick question, does anyone know exactly what curl_setopt( $ch, CURLOPT_VERBOSE, 1 ); does or means? What's the different between having it and not having it, please explain, not just "o it writes to the STDERRRERE", thanks!
×
×
  • 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.